[cfe-commits] r57896 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRState.h include/clang/Analysis/PathSensitive/Store.h lib/Analysis/BasicStore.cpp lib/Analysis/GRState.cpp lib/Analysis/RegionStore.cpp

Zhongxing Xu xuzhongxing at gmail.com
Mon Oct 20 23:27:32 PDT 2008


Author: zhongxingxu
Date: Tue Oct 21 01:27:32 2008
New Revision: 57896

URL: http://llvm.org/viewvc/llvm-project?rev=57896&view=rev
Log:
Modify Store interface: GetSVal/SetSVal => Retrieve/Bind.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
    cfe/trunk/include/clang/Analysis/PathSensitive/Store.h
    cfe/trunk/lib/Analysis/BasicStore.cpp
    cfe/trunk/lib/Analysis/GRState.cpp
    cfe/trunk/lib/Analysis/RegionStore.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h?rev=57896&r1=57895&r2=57896&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Tue Oct 21 01:27:32 2008
@@ -422,7 +422,7 @@
     
   
   SVal GetSVal(const GRState* St, Loc LV, QualType T = QualType()) {
-    return StoreMgr->GetSVal(St->getStore(), LV, T);
+    return StoreMgr->Retrieve(St->getStore(), LV, T);
   }
   
   SVal GetSVal(const GRState* St, const MemRegion* R) {
@@ -430,7 +430,7 @@
   }  
   
   void SetSVal(GRState& St, Loc LV, SVal V) {
-    St.St = StoreMgr->SetSVal(St.St, LV, V);
+    St.St = StoreMgr->Bind(St.St, LV, V);
   }
   
   const GRState* SetSVal(const GRState* St, Loc LV, SVal V);  

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/Store.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/Store.h?rev=57896&r1=57895&r2=57896&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/Store.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/Store.h Tue Oct 21 01:27:32 2008
@@ -39,13 +39,13 @@
   typedef llvm::DenseSet<SymbolID>          DeadSymbolsTy;
   
   virtual ~StoreManager() {}
-  virtual SVal GetSVal(Store St, Loc LV, QualType T = QualType()) = 0;  
+  virtual SVal Retrieve(Store St, Loc LV, QualType T = QualType()) = 0;  
 
   virtual SVal GetRegionSVal(Store St, const MemRegion* R) {
-    return GetSVal(St, loc::MemRegionVal(R));
+    return Retrieve(St, loc::MemRegionVal(R));
   }
   
-  virtual Store SetSVal(Store St, Loc LV, SVal V) = 0;
+  virtual Store Bind(Store St, Loc LV, SVal V) = 0;
   virtual Store Remove(Store St, Loc LV) = 0;
   virtual Store getInitialStore() = 0;
   virtual MemRegionManager& getRegionManager() = 0;

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

==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Tue Oct 21 01:27:32 2008
@@ -34,8 +34,8 @@
   
   virtual ~BasicStoreManager() {}
 
-  virtual SVal GetSVal(Store St, Loc LV, QualType T);  
-  virtual Store SetSVal(Store St, Loc LV, SVal V);  
+  virtual SVal Retrieve(Store St, Loc LV, QualType T);  
+  virtual Store Bind(Store St, Loc LV, SVal V);  
   virtual Store Remove(Store St, Loc LV);
 
   virtual Store getInitialStore();
@@ -133,7 +133,7 @@
   return Base;
 }
 
-SVal BasicStoreManager::GetSVal(Store St, Loc LV, QualType T) {
+SVal BasicStoreManager::Retrieve(Store St, Loc LV, QualType T) {
   
   if (isa<UnknownVal>(LV))
     return UnknownVal();
@@ -177,7 +177,7 @@
   return UnknownVal();
 }
   
-Store BasicStoreManager::SetSVal(Store store, Loc LV, SVal V) {    
+Store BasicStoreManager::Bind(Store store, Loc LV, SVal V) {    
   switch (LV.getSubKind()) {      
     case loc::MemRegionKind: {
       const VarRegion* R =
@@ -315,7 +315,7 @@
                  ? SVal::GetSymbolValue(StateMgr.getSymbolManager(), VD)
                  : UndefinedVal();
 
-        St = SetSVal(St, loc::MemRegionVal(MRMgr.getVarRegion(VD)), X);
+        St = Bind(St, loc::MemRegionVal(MRMgr.getVarRegion(VD)), X);
       }
     }
   }
@@ -355,16 +355,16 @@
       if (!Ex) {
         QualType T = VD->getType();
         if (Loc::IsLocType(T))
-          store = SetSVal(store, getLoc(VD),
-                          loc::ConcreteInt(BasicVals.getValue(0, T)));
+          store = Bind(store, getLoc(VD),
+                       loc::ConcreteInt(BasicVals.getValue(0, T)));
         else if (T->isIntegerType())
-          store = SetSVal(store, getLoc(VD),
-                          nonloc::ConcreteInt(BasicVals.getValue(0, T)));
+          store = Bind(store, getLoc(VD),
+                       nonloc::ConcreteInt(BasicVals.getValue(0, T)));
         else {
           // assert(0 && "ignore other types of variables");
         }
       } else {
-        store = SetSVal(store, getLoc(VD), InitVal);
+        store = Bind(store, getLoc(VD), InitVal);
       }
     }
   } else {
@@ -382,7 +382,7 @@
           : cast<SVal>(nonloc::SymbolVal(Sym));
       }
 
-      store = SetSVal(store, getLoc(VD), V);
+      store = Bind(store, getLoc(VD), V);
     }
   }
 

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRState.cpp (original)
+++ cfe/trunk/lib/Analysis/GRState.cpp Tue Oct 21 01:27:32 2008
@@ -63,7 +63,7 @@
                                              SVal V) {
   
   Store OldStore = St->getStore();
-  Store NewStore = StoreMgr->SetSVal(OldStore, LV, V);
+  Store NewStore = StoreMgr->Bind(OldStore, LV, V);
   
   if (NewStore == OldStore)
     return St;

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

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Tue Oct 21 01:27:32 2008
@@ -38,8 +38,8 @@
 
   virtual ~RegionStoreManager() {}
 
-  SVal GetSVal(Store S, Loc L, QualType T);
-  Store SetSVal(Store St, Loc LV, SVal V);
+  SVal Retrieve(Store S, Loc L, QualType T);
+  Store Bind(Store St, Loc LV, SVal V);
 
   Store getInitialStore();
 
@@ -65,7 +65,7 @@
   return loc::MemRegionVal(ER);
 }
 
-SVal RegionStoreManager::GetSVal(Store S, Loc L, QualType T) {
+SVal RegionStoreManager::Retrieve(Store S, Loc L, QualType T) {
   assert(!isa<UnknownVal>(L) && "location unknown");
   assert(!isa<UndefinedVal>(L) && "location undefined");
 
@@ -97,7 +97,7 @@
   }
 }
 
-Store RegionStoreManager::SetSVal(Store store, Loc LV, SVal V) {
+Store RegionStoreManager::Bind(Store store, Loc LV, SVal V) {
   assert(LV.getSubKind() == loc::MemRegionKind);
 
   const MemRegion* R = cast<loc::MemRegionVal>(LV).getRegion();
@@ -135,7 +135,7 @@
                  ? SVal::GetSymbolValue(StateMgr.getSymbolManager(), VD)
                  : UndefinedVal();
 
-        St = SetSVal(St, getVarLoc(VD), X);
+        St = Bind(St, getVarLoc(VD), X);
       }
     }
   }
@@ -160,16 +160,16 @@
         QualType T = VD->getType();
 
         if (Loc::IsLocType(T))
-          store = SetSVal(store, getVarLoc(VD),
-                          loc::ConcreteInt(BasicVals.getValue(0, T)));
+          store = Bind(store, getVarLoc(VD),
+                       loc::ConcreteInt(BasicVals.getValue(0, T)));
 
         else if (T->isIntegerType())
-          store = SetSVal(store, getVarLoc(VD),
-                          loc::ConcreteInt(BasicVals.getValue(0, T)));
+          store = Bind(store, getVarLoc(VD),
+                       loc::ConcreteInt(BasicVals.getValue(0, T)));
         else
           assert("ignore other types of variables");
       } else {
-        store = SetSVal(store, getVarLoc(VD), InitVal);
+        store = Bind(store, getVarLoc(VD), InitVal);
       }
     }
   } else {
@@ -186,7 +186,7 @@
           ? cast<SVal>(loc::SymbolVal(Sym))
           : cast<SVal>(nonloc::SymbolVal(Sym));
       }
-      store = SetSVal(store, getVarLoc(VD), V);
+      store = Bind(store, getVarLoc(VD), V);
 
     } else if (T->isArrayType()) {
       // Only handle constant size array.
@@ -197,7 +197,7 @@
         for (llvm::APInt i = llvm::APInt::getNullValue(Size.getBitWidth());
              i != Size; ++i) {
           nonloc::ConcreteInt Idx(BasicVals.getValue(llvm::APSInt(i)));
-          store = SetSVal(store, getElementLoc(VD, Idx), UndefinedVal());
+          store = Bind(store, getElementLoc(VD, Idx), UndefinedVal());
         }
       }
     } else if (T->isStructureType()) {





More information about the cfe-commits mailing list