]> granicus.if.org Git - clang/commitdiff
Remove a use of raw pointer ownership (then non-ownership) in TrimmedGraph::popNextRe...
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 5 Sep 2014 00:11:25 +0000 (00:11 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 5 Sep 2014 00:11:25 +0000 (00:11 +0000)
(just cleaning up unique_ptr stuff by finding interesting 'reset' calls
at the moment)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217210 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/BugReporter.cpp

index 342c4e66d7d2c5aa812ee717e5f61f347aa4bc71..0b9c95c1dfe52b054ebf48edd6c43b120ead2448 100644 (file)
@@ -2920,8 +2920,7 @@ bool TrimmedGraph::popNextReportGraph(ReportGraph &GraphWrapper) {
 
   // Create a new graph with a single path.  This is the graph
   // that will be returned to the caller.
-  ExplodedGraph *GNew = new ExplodedGraph();
-  GraphWrapper.Graph.reset(GNew);
+  auto GNew = llvm::make_unique<ExplodedGraph>();
   GraphWrapper.BackMap.clear();
 
   // Now walk from the error node up the BFS path, always taking the
@@ -2958,6 +2957,8 @@ bool TrimmedGraph::popNextReportGraph(ReportGraph &GraphWrapper) {
                           PriorityCompare<false>(PriorityMap));
   }
 
+  GraphWrapper.Graph = std::move(GNew);
+
   return true;
 }