[cfe-commits] r138259 - /cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp

Anna Zaks ganna at apple.com
Mon Aug 22 11:54:07 PDT 2011


Author: zaks
Date: Mon Aug 22 13:54:07 2011
New Revision: 138259

URL: http://llvm.org/viewvc/llvm-project?rev=138259&view=rev
Log:
Clean up the CFRefBugReport - remove the members, which got moved to the CFRefReportVisitors.

Modified:
    cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp

Modified: cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp?rev=138259&r1=138258&r2=138259&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CFRefCount.cpp Mon Aug 22 13:54:07 2011
@@ -1945,38 +1945,30 @@
   };
 
   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<ranges_iterator, ranges_iterator> getRanges() {
-      if (!getBugType().isLeak())
+      const CFRefBug& BugTy = static_cast<CFRefBug&>(getBugType());
+      if (!BugTy.isLeak())
         return BugReport::getRanges();
       else
         return std::make_pair(ranges_iterator(), ranges_iterator());
     }
 
-    SymbolRef getSymbol() const { return Sym; }
-
     std::pair<const char**,const char**> getExtraDescriptiveText();
   };
 
@@ -2468,7 +2460,7 @@
   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();





More information about the cfe-commits mailing list