r217210 - Remove a use of raw pointer ownership (then non-ownership) in TrimmedGraph::popNextReportGraph
David Blaikie
dblaikie at gmail.com
Thu Sep 4 17:11:25 PDT 2014
Author: dblaikie
Date: Thu Sep 4 19:11:25 2014
New Revision: 217210
URL: http://llvm.org/viewvc/llvm-project?rev=217210&view=rev
Log:
Remove a use of raw pointer ownership (then non-ownership) in TrimmedGraph::popNextReportGraph
(just cleaning up unique_ptr stuff by finding interesting 'reset' calls
at the moment)
Modified:
cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
Modified: cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp?rev=217210&r1=217209&r2=217210&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp Thu Sep 4 19:11:25 2014
@@ -2920,8 +2920,7 @@ bool TrimmedGraph::popNextReportGraph(Re
// 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(Re
PriorityCompare<false>(PriorityMap));
}
+ GraphWrapper.Graph = std::move(GNew);
+
return true;
}
More information about the cfe-commits
mailing list