From 43e3717bdbb283e92be521167f0dc93b8ed86371 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 29 Aug 2014 19:57:52 +0000 Subject: unique_ptrify thep passing of BugReports to BugReportEquivClass I suspect llvm::ilist should take elements by unique_ptr, since it does take ownership of the element (by stitching it into the linked list) - one day. llvm-svn: 216761 --- clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp') diff --git a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 89fd8d3e1b1..f01fc796771 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -3278,12 +3278,11 @@ void BugReporter::emitReport(BugReport* R) { BugReportEquivClass* EQ = EQClasses.FindNodeOrInsertPos(ID, InsertPos); if (!EQ) { - EQ = new BugReportEquivClass(UniqueR.release()); + EQ = new BugReportEquivClass(std::move(UniqueR)); EQClasses.InsertNode(EQ, InsertPos); EQClassesVector.push_back(EQ); - } - else - EQ->AddReport(UniqueR.release()); + } else + EQ->AddReport(std::move(UniqueR)); } -- cgit v1.2.3