To make the analysis independent on the locally stored liveness and cfg
of GRStateManager and GRExprEngine, pass the initial location context
to the getInitialState() method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79228 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp
index dc7c799..828ea26 100644
--- a/lib/Analysis/GRState.cpp
+++ b/lib/Analysis/GRState.cpp
@@ -115,12 +115,12 @@
return bindExpr(Ex, V, isBlkExpr, Invalidate);
}
-const GRState* GRStateManager::getInitialState() {
- GRState StateImpl(this, EnvMgr.getInitialEnvironment(),
- StoreMgr->getInitialStore(),
- GDMFactory.GetEmptyMap());
+const GRState* GRStateManager::getInitialState(const LocationContext *InitLoc) {
+ GRState State(this, EnvMgr.getInitialEnvironment(),
+ StoreMgr->getInitialStore(InitLoc),
+ GDMFactory.GetEmptyMap());
- return getPersistentState(StateImpl);
+ return getPersistentState(State);
}
const GRState* GRStateManager::getPersistentState(GRState& State) {