From 4e7713c04d24f38a5d27050b149ab12249eeb4d7 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sat, 23 Aug 2008 00:50:55 +0000 Subject: Simplify interface to Store::AddDecl llvm-svn: 55213 --- clang/lib/Analysis/BasicStore.cpp | 14 +++++++++----- clang/lib/Analysis/GRState.cpp | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'clang/lib/Analysis') diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp index ad0e12aa4c1..2ed89c6f7d4 100644 --- a/clang/lib/Analysis/BasicStore.cpp +++ b/clang/lib/Analysis/BasicStore.cpp @@ -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; diff --git a/clang/lib/Analysis/GRState.cpp b/clang/lib/Analysis/GRState.cpp index f9257274a6a..f1e07907fd1 100644 --- a/clang/lib/Analysis/GRState.cpp +++ b/clang/lib/Analysis/GRState.cpp @@ -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); -- cgit v1.2.3