diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-01-05 17:26:53 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-01-05 17:26:53 +0000 |
commit | 0a0c275ffd5b83411194e4a14ae6294500240003 (patch) | |
tree | 5c1a532e7e49b1e40aa0961308cebb9db5c843eb /clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp | |
parent | 16a6efe43d28122cdc11ca193022584f4aaabed5 (diff) | |
download | bcm5719-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/ValistChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp index b4bfa0c0334..0b7a4865ddc 100644 --- a/clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/ValistChecker.cpp @@ -91,10 +91,10 @@ private: return llvm::make_unique<PathDiagnosticEventPiece>(L, BR.getDescription(), false); } - PathDiagnosticPiece *VisitNode(const ExplodedNode *N, - const ExplodedNode *PrevN, - BugReporterContext &BRC, - BugReport &BR) override; + std::shared_ptr<PathDiagnosticPiece> VisitNode(const ExplodedNode *N, + const ExplodedNode *PrevN, + BugReporterContext &BRC, + BugReport &BR) override; private: const MemRegion *Reg; @@ -335,7 +335,7 @@ void ValistChecker::checkVAListEndCall(const CallEvent &Call, C.addTransition(State); } -PathDiagnosticPiece *ValistChecker::ValistBugVisitor::VisitNode( +std::shared_ptr<PathDiagnosticPiece> ValistChecker::ValistBugVisitor::VisitNode( const ExplodedNode *N, const ExplodedNode *PrevN, BugReporterContext &BRC, BugReport &BR) { ProgramStateRef State = N->getState(); @@ -358,7 +358,7 @@ PathDiagnosticPiece *ValistChecker::ValistBugVisitor::VisitNode( PathDiagnosticLocation Pos(S, BRC.getSourceManager(), N->getLocationContext()); - return new PathDiagnosticEventPiece(Pos, Msg, true); + return std::make_shared<PathDiagnosticEventPiece>(Pos, Msg, true); } #define REGISTER_CHECKER(name) \ |