[cfe-commits] r60204 - in /cfe/trunk/include/clang/Analysis/PathSensitive: ConstraintManager.h GRExprEngine.h GRState.h

Zhongxing Xu xuzhongxing at gmail.com
Thu Nov 27 19:07:06 PST 2008


Author: zhongxingxu
Date: Thu Nov 27 21:07:05 2008
New Revision: 60204

URL: http://llvm.org/viewvc/llvm-project?rev=60204&view=rev
Log:
Enable the GRStateManager to do something when we finish a path. For example, 
the ConstraintManager can print its internal state before its solver instance is
destroyed.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/ConstraintManager.h
    cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
    cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h

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

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/ConstraintManager.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/ConstraintManager.h Thu Nov 27 21:07:05 2008
@@ -51,6 +51,8 @@
 
   virtual void print(const GRState* St, std::ostream& Out, 
                      const char* nl, const char *sep) = 0;
+
+  virtual void EndPath(const GRState* St) {}
 };
 
 ConstraintManager* CreateBasicConstraintManager(GRStateManager& statemgr);

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

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Thu Nov 27 21:07:05 2008
@@ -414,6 +414,7 @@
   ///  nodes when the control reaches the end of a function.
   void ProcessEndPath(EndPathNodeBuilder& builder) {
     getTF().EvalEndPath(*this, builder);
+    StateMgr.EndPath(builder.getState());
   }
   
   GRStateManager& getStateManager() { return StateMgr; }

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

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Thu Nov 27 21:07:05 2008
@@ -536,6 +536,10 @@
   const llvm::APSInt* getSymVal(const GRState* St, SymbolID sym) {
     return ConstraintMgr->getSymVal(St, sym);
   }
+
+  void EndPath(const GRState* St) {
+    ConstraintMgr->EndPath(St);
+  }
 };
   
 //===----------------------------------------------------------------------===//





More information about the cfe-commits mailing list