summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-06-23 13:15:32 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-06-23 13:15:32 +0000
commit8d3a7a56a944f6b8452cb8e21ba68a293c7f5202 (patch)
treee7f2906cae208f6db629b25f46559dddb46ff5a1 /clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
parent91d35a5e225c592a885ca993ce5628228ff26a49 (diff)
downloadbcm5719-llvm-8d3a7a56a944f6b8452cb8e21ba68a293c7f5202.tar.gz
bcm5719-llvm-8d3a7a56a944f6b8452cb8e21ba68a293c7f5202.zip
Clarify pointer ownership semantics by hoisting the std::unique_ptr creation to the caller instead of hiding it in emitReport. NFC.
llvm-svn: 240400
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
index 51bc7e66dce..93b0553b3b7 100644
--- a/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
@@ -160,8 +160,7 @@ void ObjCSelfInitChecker::checkForInvalidSelf(const Expr *E, CheckerContext &C,
if (!BT)
BT.reset(new BugType(this, "Missing \"self = [(super or self) init...]\"",
categories::CoreFoundationObjectiveC));
- BugReport *report = new BugReport(*BT, errorStr, N);
- C.emitReport(report);
+ C.emitReport(llvm::make_unique<BugReport>(*BT, errorStr, N));
}
void ObjCSelfInitChecker::checkPostObjCMessage(const ObjCMethodCall &Msg,
OpenPOWER on IntegriCloud