diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-29 19:57:52 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-29 19:57:52 +0000 |
commit | 43e3717bdbb283e92be521167f0dc93b8ed86371 (patch) | |
tree | 076d23c4c42c31fc56515cf612356bf2e116ce20 /clang/lib/StaticAnalyzer/Core/BugReporter.cpp | |
parent | ffe5106fe6b0e55e8361493e9b998b77b47326fe (diff) | |
download | bcm5719-llvm-43e3717bdbb283e92be521167f0dc93b8ed86371.tar.gz bcm5719-llvm-43e3717bdbb283e92be521167f0dc93b8ed86371.zip |
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
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/BugReporter.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/BugReporter.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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)); } |