Move the handling of DeclStmt from GRExprEngine to BasicStoreManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55144 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp
index 1cee484..f925727 100644
--- a/lib/Analysis/GRState.cpp
+++ b/lib/Analysis/GRState.cpp
@@ -142,6 +142,24 @@
return getPersistentState(NewSt);
}
+const GRState* GRStateManager::AddDecl(const GRState* St, const VarDecl* VD,
+ Expr* Ex, unsigned Count) {
+ Store OldStore = St->getStore();
+ Store NewStore;
+
+ if (Ex)
+ NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex,
+ GetRVal(St, Ex), Count);
+ else
+ NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex);
+
+ if (NewStore == OldStore)
+ return St;
+ GRState NewSt = *St;
+ NewSt.St = NewStore;
+ return getPersistentState(NewSt);
+}
+
const GRState* GRStateManager::Unbind(const GRState* St, LVal LV) {
Store OldStore = St->getStore();
Store NewStore = StMgr->Remove(OldStore, LV);