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
diff --git a/include/clang/Analysis/PathSensitive/ConstraintManager.h b/include/clang/Analysis/PathSensitive/ConstraintManager.h
index 3f2e60d..54cdecb 100644
--- a/include/clang/Analysis/PathSensitive/ConstraintManager.h
+++ b/include/clang/Analysis/PathSensitive/ConstraintManager.h
@@ -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);
diff --git a/include/clang/Analysis/PathSensitive/GRExprEngine.h b/include/clang/Analysis/PathSensitive/GRExprEngine.h
index 17be037..6b9dc03 100644
--- a/include/clang/Analysis/PathSensitive/GRExprEngine.h
+++ b/include/clang/Analysis/PathSensitive/GRExprEngine.h
@@ -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; }
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h
index c3ef35b..b1e866c 100644
--- a/include/clang/Analysis/PathSensitive/GRState.h
+++ b/include/clang/Analysis/PathSensitive/GRState.h
@@ -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);
+ }
};
//===----------------------------------------------------------------------===//