From: David Blaikie Date: Fri, 5 Sep 2014 00:11:25 +0000 (+0000) Subject: Remove a use of raw pointer ownership (then non-ownership) in TrimmedGraph::popNextRe... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=db7770b837799d27bd7019964073713ceea791b6;p=clang 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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217210 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index 342c4e66d7..0b9c95c1df 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -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(); 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(PriorityMap)); } + GraphWrapper.Graph = std::move(GNew); + return true; }