[cfe-commits] r85971 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRTransferFuncs.h lib/Analysis/CFRefCount.cpp lib/Analysis/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Tue Nov 3 15:30:34 PST 2009


Author: kremenek
Date: Tue Nov  3 17:30:34 2009
New Revision: 85971

URL: http://llvm.org/viewvc/llvm-project?rev=85971&view=rev
Log:
Change GRTransferFuncs::RegisterChecks() to take a GRExprEngine& instead of a BugReporter&.  This paves the way for pulling some of the retain/release checker into a "Checker" class.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
    cfe/trunk/lib/Analysis/CFRefCount.cpp
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h?rev=85971&r1=85970&r2=85971&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h Tue Nov  3 17:30:34 2009
@@ -23,7 +23,6 @@
 namespace clang {
 
 class GRExprEngine;
-class BugReporter;
 class ObjCMessageExpr;
 class GRStmtNodeBuilderRef;
 
@@ -33,7 +32,7 @@
   virtual ~GRTransferFuncs() {}
 
   virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {}
-  virtual void RegisterChecks(BugReporter& BR) {}
+  virtual void RegisterChecks(GRExprEngine& Eng) {}
 
 
   // Calls.
@@ -78,7 +77,7 @@
   virtual const GRState* EvalAssume(const GRState *state,
                                     SVal Cond, bool Assumption) {
     return state;
-  }
+  }  
 };
 
 GRTransferFuncs *CreateCallInliner(ASTContext &ctx);

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=85971&r1=85970&r2=85971&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue Nov  3 17:30:34 2009
@@ -1899,7 +1899,7 @@
 
   virtual ~CFRefCount() {}
 
-  void RegisterChecks(BugReporter &BR);
+  void RegisterChecks(GRExprEngine &Eng);
 
   virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {
     Printers.push_back(new BindingsPrinter());
@@ -2193,7 +2193,9 @@
   };
 } // end anonymous namespace
 
-void CFRefCount::RegisterChecks(BugReporter& BR) {
+void CFRefCount::RegisterChecks(GRExprEngine& Eng) {
+  BugReporter &BR = Eng.getBugReporter();
+  
   useAfterRelease = new UseAfterRelease(this);
   BR.Register(useAfterRelease);
 

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=85971&r1=85970&r2=85971&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Tue Nov  3 17:30:34 2009
@@ -178,7 +178,7 @@
 
 void GRExprEngine::setTransferFunctions(GRTransferFuncs* tf) {
   StateMgr.TF = tf;
-  tf->RegisterChecks(getBugReporter());
+  tf->RegisterChecks(*this);
   tf->RegisterPrinters(getStateManager().Printers);
 }
 





More information about the cfe-commits mailing list