public:
// Typedefs.
typedef llvm::ImmutableSet<llvm::APSInt*> IntSetTy;
+ typedef llvm::ImmutableMap<void*, void*> GenericDataMap;
typedef llvm::ImmutableMap<SymbolID,IntSetTy> ConstNotEqTy;
typedef llvm::ImmutableMap<SymbolID,const llvm::APSInt*> ConstEqTy;
// FIXME: Make these private.
public:
+ GenericDataMap GDM;
ConstNotEqTy ConstNotEq;
ConstEqTy ConstEq;
void* CheckerState;
public:
/// This ctor is used when creating the first ValueState object.
- ValueState(const Environment& env, Store st,
+ ValueState(const Environment& env, Store st, GenericDataMap gdm,
ConstNotEqTy CNE, ConstEqTy CE)
: Env(env),
St(st),
+ GDM(gdm),
ConstNotEq(CNE),
ConstEq(CE),
CheckerState(NULL) {}
: llvm::FoldingSetNode(),
Env(RHS.Env),
St(RHS.St),
+ GDM(RHS.GDM),
ConstNotEq(RHS.ConstNotEq),
ConstEq(RHS.ConstEq),
CheckerState(RHS.CheckerState) {}
/// is a mapping from locations to values.
Store getStore() const { return St; }
+ /// getGDM - Return the generic data map associated with this state.
+ GenericDataMap getGDM() const { return GDM; }
+
/// Profile - Profile the contents of a ValueState object for use
/// in a FoldingSet.
static void Profile(llvm::FoldingSetNodeID& ID, const ValueState* V) {
V->Env.Profile(ID);
ID.AddPointer(V->St);
+ V->GDM.Profile(ID);
V->ConstNotEq.Profile(ID);
V->ConstEq.Profile(ID);
ID.AddPointer(V->CheckerState);
EnvironmentManager EnvMgr;
llvm::OwningPtr<StoreManager> StMgr;
ValueState::IntSetTy::Factory ISetFactory;
+ ValueState::GenericDataMap::Factory GDMFactory;
ValueState::ConstNotEqTy::Factory CNEFactory;
ValueState::ConstEqTy::Factory CEFactory;
: EnvMgr(alloc),
StMgr(stmgr),
ISetFactory(alloc),
+ GDMFactory(alloc),
CNEFactory(alloc),
CEFactory(alloc),
BasicVals(Ctx, alloc),
return SetRVal(St, Ex, V, isBlkExpr, true);
}
+
+ // Methods that manipulate the GDM.
+ const ValueState* addGDM(const ValueState* St, void* Key, void* Data) {
+ ValueState::GenericDataMap M1 = St->getGDM();
+ ValueState::GenericDataMap M2 = GDMFactory.Add(M2, Key, Data);
+
+ if (M1 == M2)
+ return St;
+
+ ValueState NewSt = *St;
+ NewSt.GDM = M2;
+ return getPersistentState(NewSt);
+ }
// Methods that query & manipulate the Store.
-
RVal GetRVal(const ValueState* St, LVal LV, QualType T = QualType()) {
return StMgr->GetRVal(St->getStore(), LV, T);
}