diff options
author | Jordy Rose <jediknil@belkadan.com> | 2012-03-24 02:45:35 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2012-03-24 02:45:35 +0000 |
commit | f78877e99a85b2396ea93ebc2f08452a9c5bc795 (patch) | |
tree | bc5e70cc976f5a68839d99e16f22ac75a8b03759 /clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | |
parent | 6db850133f66abbe89a2d6c0f161c063eba79840 (diff) | |
download | bcm5719-llvm-f78877e99a85b2396ea93ebc2f08452a9c5bc795.tar.gz bcm5719-llvm-f78877e99a85b2396ea93ebc2f08452a9c5bc795.zip |
[analyzer] Add a clone() method to BugReporterVisitor, so that we'll be able to reset diagnostic generation.
llvm-svn: 153368
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index bf4b76c6405..92557961728 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -1713,7 +1713,7 @@ namespace { // Bug Reports. // //===---------===// - class CFRefReportVisitor : public BugReporterVisitor { + class CFRefReportVisitor : public BugReporterVisitorImpl<CFRefReportVisitor> { protected: SymbolRef Sym; const SummaryLogTy &SummaryLog; @@ -1748,6 +1748,15 @@ namespace { PathDiagnosticPiece *getEndPath(BugReporterContext &BRC, const ExplodedNode *N, BugReport &BR); + + virtual BugReporterVisitor *clone() const { + // The curiously-recurring template pattern only works for one level of + // subclassing. Rather than make a new template base for + // CFRefReportVisitor, we simply override clone() to do the right thing. + // This could be trouble someday if BugReporterVisitorImpl is ever + // used for something else besides a convenient implementation of clone(). + return new CFRefLeakReportVisitor(*this); + } }; class CFRefReport : public BugReport { |