[cfe-commits] r61069 - /cfe/trunk/lib/Analysis/RegionStore.cpp

Zhongxing Xu xuzhongxing at gmail.com
Mon Dec 15 18:36:33 PST 2008


Author: zhongxingxu
Date: Mon Dec 15 20:36:30 2008
New Revision: 61069

URL: http://llvm.org/viewvc/llvm-project?rev=61069&view=rev
Log:
Implement RegionStoreManager::Remove().

Modified:
    cfe/trunk/lib/Analysis/RegionStore.cpp

Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=61069&r1=61068&r2=61069&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Mon Dec 15 20:36:30 2008
@@ -111,10 +111,7 @@
 
   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 @@
   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 @@
          : 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 @@
       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)) {





More information about the cfe-commits mailing list