forked from OSchip/llvm-project
parent
ac37f9a9be
commit
4e7713c04d
|
@ -46,8 +46,8 @@ public:
|
||||||
DeclRootsTy& DRoots, LiveSymbolsTy& LSymbols,
|
DeclRootsTy& DRoots, LiveSymbolsTy& LSymbols,
|
||||||
DeadSymbolsTy& DSymbols) = 0;
|
DeadSymbolsTy& DSymbols) = 0;
|
||||||
|
|
||||||
virtual Store AddDecl(Store store, BasicValueFactory& BasicVals,
|
virtual Store AddDecl(Store store, GRStateManager& StMgr,
|
||||||
SymbolManager& SymMgr, const VarDecl* VD, Expr* Ex,
|
const VarDecl* VD, Expr* Ex,
|
||||||
RVal InitVal = UndefinedVal(), unsigned Count = 0) = 0;
|
RVal InitVal = UndefinedVal(), unsigned Count = 0) = 0;
|
||||||
|
|
||||||
virtual void print(Store store, std::ostream& Out,
|
virtual void print(Store store, std::ostream& Out,
|
||||||
|
|
|
@ -41,8 +41,8 @@ public:
|
||||||
DeclRootsTy& DRoots, LiveSymbolsTy& LSymbols,
|
DeclRootsTy& DRoots, LiveSymbolsTy& LSymbols,
|
||||||
DeadSymbolsTy& DSymbols);
|
DeadSymbolsTy& DSymbols);
|
||||||
|
|
||||||
virtual Store AddDecl(Store store, BasicValueFactory& BasicVals,
|
virtual Store AddDecl(Store store, GRStateManager& StateMgr,
|
||||||
SymbolManager& SymMgr, const VarDecl* VD, Expr* Ex,
|
const VarDecl* VD, Expr* Ex,
|
||||||
RVal InitVal = UndefinedVal(), unsigned Count = 0);
|
RVal InitVal = UndefinedVal(), unsigned Count = 0);
|
||||||
|
|
||||||
static inline VarBindingsTy GetVarBindings(Store store) {
|
static inline VarBindingsTy GetVarBindings(Store store) {
|
||||||
|
@ -243,9 +243,13 @@ Store BasicStoreManager::getInitialStore(GRStateManager& StateMgr) {
|
||||||
return St;
|
return St;
|
||||||
}
|
}
|
||||||
|
|
||||||
Store BasicStoreManager::AddDecl(Store store, BasicValueFactory& BasicVals,
|
Store BasicStoreManager::AddDecl(Store store, GRStateManager& StateMgr,
|
||||||
SymbolManager& SymMgr, const VarDecl* VD,
|
const VarDecl* VD, Expr* Ex,
|
||||||
Expr* Ex, RVal InitVal, unsigned Count) {
|
RVal InitVal, unsigned Count) {
|
||||||
|
|
||||||
|
BasicValueFactory& BasicVals = StateMgr.getBasicVals();
|
||||||
|
SymbolManager& SymMgr = StateMgr.getSymbolManager();
|
||||||
|
|
||||||
// BasicStore does not model arrays and structs.
|
// BasicStore does not model arrays and structs.
|
||||||
if (VD->getType()->isArrayType() || VD->getType()->isStructureType())
|
if (VD->getType()->isArrayType() || VD->getType()->isStructureType())
|
||||||
return store;
|
return store;
|
||||||
|
|
|
@ -148,13 +148,14 @@ const GRState* GRStateManager::AddDecl(const GRState* St, const VarDecl* VD,
|
||||||
Store NewStore;
|
Store NewStore;
|
||||||
|
|
||||||
if (Ex)
|
if (Ex)
|
||||||
NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex,
|
NewStore = StMgr->AddDecl(OldStore, *this, VD, Ex,
|
||||||
GetRVal(St, Ex), Count);
|
GetRVal(St, Ex), Count);
|
||||||
else
|
else
|
||||||
NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex);
|
NewStore = StMgr->AddDecl(OldStore, *this, VD, Ex);
|
||||||
|
|
||||||
if (NewStore == OldStore)
|
if (NewStore == OldStore)
|
||||||
return St;
|
return St;
|
||||||
|
|
||||||
GRState NewSt = *St;
|
GRState NewSt = *St;
|
||||||
NewSt.St = NewStore;
|
NewSt.St = NewStore;
|
||||||
return getPersistentState(NewSt);
|
return getPersistentState(NewSt);
|
||||||
|
|
Loading…
Reference in New Issue