aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-11-28 03:07:05 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-11-28 03:07:05 +0000
commite73dc26690776887bd2991461f6814498600d6eb (patch)
tree10daded4ec2a58e4fb13f267383567e10edba797
parenta7fb9f8c802b67b8a4a95355b19eaf408c622e95 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60204 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/ConstraintManager.h2
-rw-r--r--include/clang/Analysis/PathSensitive/GRExprEngine.h1
-rw-r--r--include/clang/Analysis/PathSensitive/GRState.h4
3 files changed, 7 insertions, 0 deletions
diff --git a/include/clang/Analysis/PathSensitive/ConstraintManager.h b/include/clang/Analysis/PathSensitive/ConstraintManager.h
index 3f2e60d3ef..54cdecbf21 100644
--- a/include/clang/Analysis/PathSensitive/ConstraintManager.h
+++ b/include/clang/Analysis/PathSensitive/ConstraintManager.h
@@ -51,6 +51,8 @@ public:
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);
diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h
index 17be0370de..6b9dc03679 100644
--- a/include/clang/Analysis/PathSensitive/GRExprEngine.h
+++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h
@@ -414,6 +414,7 @@ public:
/// 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; }
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h
index c3ef35b460..b1e866c67c 100644
--- a/include/clang/Analysis/PathSensitive/GRState.h
+++ b/include/clang/Analysis/PathSensitive/GRState.h
@@ -536,6 +536,10 @@ public:
const llvm::APSInt* getSymVal(const GRState* St, SymbolID sym) {
return ConstraintMgr->getSymVal(St, sym);
}
+
+ void EndPath(const GRState* St) {
+ ConstraintMgr->EndPath(St);
+ }
};
//===----------------------------------------------------------------------===//