Simplify interface to Store::AddDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55213 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Analysis/PathSensitive/Store.h b/include/clang/Analysis/PathSensitive/Store.h
index eaa4a78..be824e7 100644
--- a/include/clang/Analysis/PathSensitive/Store.h
+++ b/include/clang/Analysis/PathSensitive/Store.h
@@ -46,8 +46,8 @@
DeclRootsTy& DRoots, LiveSymbolsTy& LSymbols,
DeadSymbolsTy& DSymbols) = 0;
- virtual Store AddDecl(Store store, BasicValueFactory& BasicVals,
- SymbolManager& SymMgr, const VarDecl* VD, Expr* Ex,
+ virtual Store AddDecl(Store store, GRStateManager& StMgr,
+ const VarDecl* VD, Expr* Ex,
RVal InitVal = UndefinedVal(), unsigned Count = 0) = 0;
virtual void print(Store store, std::ostream& Out,
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index ad0e12a..2ed89c6 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/lib/Analysis/BasicStore.cpp
@@ -41,8 +41,8 @@
DeclRootsTy& DRoots, LiveSymbolsTy& LSymbols,
DeadSymbolsTy& DSymbols);
- virtual Store AddDecl(Store store, BasicValueFactory& BasicVals,
- SymbolManager& SymMgr, const VarDecl* VD, Expr* Ex,
+ virtual Store AddDecl(Store store, GRStateManager& StateMgr,
+ const VarDecl* VD, Expr* Ex,
RVal InitVal = UndefinedVal(), unsigned Count = 0);
static inline VarBindingsTy GetVarBindings(Store store) {
@@ -243,9 +243,13 @@
return St;
}
-Store BasicStoreManager::AddDecl(Store store, BasicValueFactory& BasicVals,
- SymbolManager& SymMgr, const VarDecl* VD,
- Expr* Ex, RVal InitVal, unsigned Count) {
+Store BasicStoreManager::AddDecl(Store store, GRStateManager& StateMgr,
+ const VarDecl* VD, Expr* Ex,
+ RVal InitVal, unsigned Count) {
+
+ BasicValueFactory& BasicVals = StateMgr.getBasicVals();
+ SymbolManager& SymMgr = StateMgr.getSymbolManager();
+
// BasicStore does not model arrays and structs.
if (VD->getType()->isArrayType() || VD->getType()->isStructureType())
return store;
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp
index f925727..f1e0790 100644
--- a/lib/Analysis/GRState.cpp
+++ b/lib/Analysis/GRState.cpp
@@ -148,13 +148,14 @@
Store NewStore;
if (Ex)
- NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex,
+ NewStore = StMgr->AddDecl(OldStore, *this, VD, Ex,
GetRVal(St, Ex), Count);
else
- NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex);
+ NewStore = StMgr->AddDecl(OldStore, *this, VD, Ex);
if (NewStore == OldStore)
return St;
+
GRState NewSt = *St;
NewSt.St = NewStore;
return getPersistentState(NewSt);