From: Anna Zaks Date: Mon, 22 Aug 2011 18:54:07 +0000 (+0000) Subject: Clean up the CFRefBugReport - remove the members, which got moved to the CFRefReportV... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=edf4daead543ab594012ef1704c7c5dd0a93f45f;p=clang Clean up the CFRefBugReport - remove the members, which got moved to the CFRefReportVisitors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138259 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/CFRefCount.cpp b/lib/StaticAnalyzer/Core/CFRefCount.cpp index 6c35d1ae9c..4ade451ba5 100644 --- a/lib/StaticAnalyzer/Core/CFRefCount.cpp +++ b/lib/StaticAnalyzer/Core/CFRefCount.cpp @@ -1945,38 +1945,30 @@ namespace { }; class CFRefReport : public BugReport { - protected: - SymbolRef Sym; - const CFRefCount &TF; public: CFRefReport(CFRefBug& D, const CFRefCount &tf, ExplodedNode *n, SymbolRef sym, bool registerVisitor = true) - : BugReport(D, D.getDescription(), n), Sym(sym), TF(tf) { + : BugReport(D, D.getDescription(), n) { if (registerVisitor) addVisitor(new CFRefReportVisitor(sym, tf)); } CFRefReport(CFRefBug& D, const CFRefCount &tf, ExplodedNode *n, SymbolRef sym, StringRef endText) - : BugReport(D, D.getDescription(), endText, n), Sym(sym), TF(tf) { + : BugReport(D, D.getDescription(), endText, n) { addVisitor(new CFRefReportVisitor(sym, tf)); } virtual ~CFRefReport() {} - CFRefBug& getBugType() const { - return (CFRefBug&) BugReport::getBugType(); - } - virtual std::pair getRanges() { - if (!getBugType().isLeak()) + const CFRefBug& BugTy = static_cast(getBugType()); + if (!BugTy.isLeak()) return BugReport::getRanges(); else return std::make_pair(ranges_iterator(), ranges_iterator()); } - SymbolRef getSymbol() const { return Sym; } - std::pair getExtraDescriptiveText(); }; @@ -2468,7 +2460,7 @@ CFRefLeakReport::CFRefLeakReport(CFRefBug& D, const CFRefCount &tf, const ExplodedNode *AllocNode = 0; llvm::tie(AllocNode, AllocBinding) = // Set AllocBinding. - GetAllocationSite(Eng.getStateManager(), getErrorNode(), getSymbol()); + GetAllocationSite(Eng.getStateManager(), getErrorNode(), sym); // Get the SourceLocation for the allocation site. ProgramPoint P = AllocNode->getLocation();