Simplify interface to Store::AddDecl

llvm-svn: 55213
This commit is contained in:
Ted Kremenek 2008-08-23 00:50:55 +00:00
parent ac37f9a9be
commit 4e7713c04d
3 changed files with 14 additions and 9 deletions

View File

@ -46,8 +46,8 @@ public:
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,

View File

@ -41,8 +41,8 @@ public:
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 @@ Store BasicStoreManager::getInitialStore(GRStateManager& StateMgr) {
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;

View File

@ -148,13 +148,14 @@ const GRState* GRStateManager::AddDecl(const GRState* St, const VarDecl* VD,
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);