diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-29 18:18:43 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-29 18:18:43 +0000 |
commit | d15481ccea21bae481a496a7acbde4532abc890c (patch) | |
tree | 137b20cf507c6f692417052c0e3658f754b71d38 /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | |
parent | f6ee7a7cddaafd3d14d522a6207eff010ad5257b (diff) | |
download | llvm-d15481ccea21bae481a496a7acbde4532abc890c.zip llvm-d15481ccea21bae481a496a7acbde4532abc890c.tar.gz llvm-d15481ccea21bae481a496a7acbde4532abc890c.tar.bz2 |
unique_ptr-ify PathDiagnosticPiece ownership
llvm-svn: 216751
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 6e49fbb..b26a4fe 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -1717,9 +1717,9 @@ namespace { BugReporterContext &BRC, BugReport &BR) override; - PathDiagnosticPiece *getEndPath(BugReporterContext &BRC, - const ExplodedNode *N, - BugReport &BR) override; + std::unique_ptr<PathDiagnosticPiece> getEndPath(BugReporterContext &BRC, + const ExplodedNode *N, + BugReport &BR) override; }; class CFRefLeakReportVisitor : public CFRefReportVisitor { @@ -1728,9 +1728,9 @@ namespace { const SummaryLogTy &log) : CFRefReportVisitor(sym, GCEnabled, log) {} - PathDiagnosticPiece *getEndPath(BugReporterContext &BRC, - const ExplodedNode *N, - BugReport &BR) override; + std::unique_ptr<PathDiagnosticPiece> getEndPath(BugReporterContext &BRC, + const ExplodedNode *N, + BugReport &BR) override; BugReporterVisitor *clone() const override { // The curiously-recurring template pattern only works for one level of @@ -2219,18 +2219,16 @@ GetAllocationSite(ProgramStateManager& StateMgr, const ExplodedNode *N, InterestingMethodContext); } -PathDiagnosticPiece* +std::unique_ptr<PathDiagnosticPiece> CFRefReportVisitor::getEndPath(BugReporterContext &BRC, - const ExplodedNode *EndN, - BugReport &BR) { + const ExplodedNode *EndN, BugReport &BR) { BR.markInteresting(Sym); return BugReporterVisitor::getDefaultEndPath(BRC, EndN, BR); } -PathDiagnosticPiece* +std::unique_ptr<PathDiagnosticPiece> CFRefLeakReportVisitor::getEndPath(BugReporterContext &BRC, - const ExplodedNode *EndN, - BugReport &BR) { + const ExplodedNode *EndN, BugReport &BR) { // Tell the BugReporterContext to report cases when the tracked symbol is // assigned to different variables, etc. @@ -2310,7 +2308,7 @@ CFRefLeakReportVisitor::getEndPath(BugReporterContext &BRC, os << " is not referenced later in this execution path and has a retain " "count of +" << RV->getCount(); - return new PathDiagnosticEventPiece(L, os.str()); + return llvm::make_unique<PathDiagnosticEventPiece>(L, os.str()); } CFRefLeakReport::CFRefLeakReport(CFRefBug &D, const LangOptions &LOpts, |