aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-29 18:18:43 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-29 18:18:43 +0000
commitd15481ccea21bae481a496a7acbde4532abc890c (patch)
tree137b20cf507c6f692417052c0e3658f754b71d38 /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
parentf6ee7a7cddaafd3d14d522a6207eff010ad5257b (diff)
downloadllvm-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.cpp24
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,