summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-01-05 17:26:53 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-01-05 17:26:53 +0000
commit0a0c275ffd5b83411194e4a14ae6294500240003 (patch)
tree5c1a532e7e49b1e40aa0961308cebb9db5c843eb /clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp
parent16a6efe43d28122cdc11ca193022584f4aaabed5 (diff)
downloadbcm5719-llvm-0a0c275ffd5b83411194e4a14ae6294500240003.tar.gz
bcm5719-llvm-0a0c275ffd5b83411194e4a14ae6294500240003.zip
Migrate PathDiagnosticPiece to std::shared_ptr
Simplifies and makes explicit the memory ownership model rather than implicitly passing/acquiring ownership. llvm-svn: 291143
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp
index e75d2089771..075ff09dcbf 100644
--- a/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/ObjCSuperDeallocChecker.cpp
@@ -73,10 +73,10 @@ public:
: ReceiverSymbol(ReceiverSymbol),
Satisfied(false) {}
- PathDiagnosticPiece *VisitNode(const ExplodedNode *Succ,
- const ExplodedNode *Pred,
- BugReporterContext &BRC,
- BugReport &BR) override;
+ std::shared_ptr<PathDiagnosticPiece> VisitNode(const ExplodedNode *Succ,
+ const ExplodedNode *Pred,
+ BugReporterContext &BRC,
+ BugReport &BR) override;
void Profile(llvm::FoldingSetNodeID &ID) const override {
ID.Add(ReceiverSymbol);
@@ -249,10 +249,10 @@ ObjCSuperDeallocChecker::isSuperDeallocMessage(const ObjCMethodCall &M) const {
return M.getSelector() == SELdealloc;
}
-PathDiagnosticPiece *SuperDeallocBRVisitor::VisitNode(const ExplodedNode *Succ,
- const ExplodedNode *Pred,
- BugReporterContext &BRC,
- BugReport &BR) {
+std::shared_ptr<PathDiagnosticPiece>
+SuperDeallocBRVisitor::VisitNode(const ExplodedNode *Succ,
+ const ExplodedNode *Pred,
+ BugReporterContext &BRC, BugReport &BR) {
if (Satisfied)
return nullptr;
@@ -275,7 +275,7 @@ PathDiagnosticPiece *SuperDeallocBRVisitor::VisitNode(const ExplodedNode *Succ,
if (!L.isValid() || !L.asLocation().isValid())
return nullptr;
- return new PathDiagnosticEventPiece(
+ return std::make_shared<PathDiagnosticEventPiece>(
L, "[super dealloc] called here");
}
OpenPOWER on IntegriCloud