diff options
| author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-12-16 02:36:30 +0000 |
|---|---|---|
| committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-12-16 02:36:30 +0000 |
| commit | c4a4c5f02d5bbc272a3a52f40d5bdd8d8f40d67c (patch) | |
| tree | 385ac32a870f1d833df976cc6046a64743dbe1ba | |
| parent | a599c1352bb9f765ba37cb0bdb8f1a0a9061598d (diff) | |
| download | bcm5719-llvm-c4a4c5f02d5bbc272a3a52f40d5bdd8d8f40d67c.tar.gz bcm5719-llvm-c4a4c5f02d5bbc272a3a52f40d5bdd8d8f40d67c.zip | |
Implement RegionStoreManager::Remove().
llvm-svn: 61069
| -rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index b78c2edb144..98b408156f1 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -111,10 +111,7 @@ public: Store Bind(Store St, Loc LV, SVal V); - Store Remove(Store store, Loc LV) { - // FIXME: Implement. - return store; - } + Store Remove(Store store, Loc LV); Store getInitialStore(); @@ -141,7 +138,7 @@ public: const GRState* setExtent(const GRState* St, const MemRegion* R, SVal Extent); static inline RegionBindingsTy GetRegionBindings(Store store) { - return RegionBindingsTy(static_cast<const RegionBindingsTy::TreeTy*>(store)); + return RegionBindingsTy(static_cast<const RegionBindingsTy::TreeTy*>(store)); } void print(Store store, std::ostream& Out, const char* nl, const char *sep); @@ -482,6 +479,15 @@ Store RegionStoreManager::Bind(Store store, Loc LV, SVal V) { : RBFactory.Add(B, R, V).getRoot(); } +Store RegionStoreManager::Remove(Store store, Loc L) { + RegionBindingsTy B = GetRegionBindings(store); + + const MemRegion* R = cast<loc::MemRegionVal>(L).getRegion(); + assert(R); + + return RBFactory.Remove(B, R).getRoot(); +} + Store RegionStoreManager::BindStruct(Store store, const TypedRegion* R, SVal V){ // Verify we want getRValueType. QualType T = R->getRValueType(getContext()); @@ -747,7 +753,7 @@ Store RegionStoreManager::RemoveDeadBindings(const GRState* state, Stmt* Loc, continue; // Remove this dead region from the store. - store = Remove(store, loc::MemRegionVal(R)); + store = Remove(store, Loc::MakeVal(R)); // Mark all non-live symbols that this region references as dead. if (const SymbolicRegion* SymR = dyn_cast<SymbolicRegion>(R)) { |

