diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-12-05 00:47:52 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-12-05 00:47:52 +0000 |
commit | 2ed14beed7dcb46245328d72ac7011c92c1bd676 (patch) | |
tree | 648920a505945b17474cd79c77d0c3527eca7fef /lib/Analysis/BasicStore.cpp | |
parent | 802db9b4d5fba62890447bea39d637896a920e44 (diff) |
StoreManager::Retrieve and StoreManager::RemoveDeadBindings now take a GRState* argument instead of a Store. This allows them to use the GDM for storing other data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60570 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BasicStore.cpp')
-rw-r--r-- | lib/Analysis/BasicStore.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp index 963254ed5c..c3146cba40 100644 --- a/lib/Analysis/BasicStore.cpp +++ b/lib/Analysis/BasicStore.cpp @@ -38,7 +38,7 @@ public: ~BasicStoreManager() {} - SVal Retrieve(Store St, Loc LV, QualType T); + SVal Retrieve(const GRState *state, Loc LV, QualType T); Store Bind(Store St, Loc LV, SVal V); Store Remove(Store St, Loc LV); Store getInitialStore(); @@ -79,10 +79,11 @@ public: return SelfRegion; } - /// RemoveDeadBindings - Scans a BasicStore for dead values. It returns - /// a new Store with these values removed, and populates LSymbols and - /// DSymbols with the known set of live and dead symbols respectively. - Store RemoveDeadBindings(Store store, Stmt* Loc, const LiveVariables& Live, + /// RemoveDeadBindings - Scans a BasicStore of 'state' for dead values. + /// It returns a new Store with these values removed, and populates LSymbols + /// and DSymbols with the known set of live and dead symbols respectively. + Store RemoveDeadBindings(const GRState* state, Stmt* Loc, + const LiveVariables& Live, llvm::SmallVectorImpl<const MemRegion*>& RegionRoots, LiveSymbolsTy& LSymbols, DeadSymbolsTy& DSymbols); @@ -168,7 +169,7 @@ SVal BasicStoreManager::getLValueElement(const GRState* St, SVal Base, return Base; } -SVal BasicStoreManager::Retrieve(Store St, Loc LV, QualType T) { +SVal BasicStoreManager::Retrieve(const GRState* state, Loc LV, QualType T) { if (isa<UnknownVal>(LV)) return UnknownVal(); @@ -183,8 +184,9 @@ SVal BasicStoreManager::Retrieve(Store St, Loc LV, QualType T) { if (!R) return UnknownVal(); - - VarBindingsTy B(static_cast<const VarBindingsTy::TreeTy*>(St)); + + Store store = state->getStore(); + VarBindingsTy B(static_cast<const VarBindingsTy::TreeTy*>(store)); VarBindingsTy::data_type* T = B.lookup(R->getDecl()); return T ? *T : UnknownVal(); } @@ -247,11 +249,12 @@ Store BasicStoreManager::Remove(Store store, Loc LV) { } Store -BasicStoreManager::RemoveDeadBindings(Store store, Stmt* Loc, +BasicStoreManager::RemoveDeadBindings(const GRState* state, Stmt* Loc, const LiveVariables& Liveness, llvm::SmallVectorImpl<const MemRegion*>& RegionRoots, LiveSymbolsTy& LSymbols, DeadSymbolsTy& DSymbols) { + Store store = state->getStore(); VarBindingsTy B = GetVarBindings(store); typedef SVal::symbol_iterator symbol_iterator; @@ -282,7 +285,7 @@ BasicStoreManager::RemoveDeadBindings(Store store, Stmt* Loc, break; Marked.insert(R); - SVal X = GetRegionSVal(store, R); + SVal X = GetRegionSVal(state, R); // FIXME: We need to handle symbols nested in region definitions. for (symbol_iterator SI=X.symbol_begin(), SE=X.symbol_end(); SI!=SE; ++SI) |