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

Zhongxing Xu xuzhongxing at gmail.com
Tue Oct 28 19:34:02 PDT 2008


Author: zhongxingxu
Date: Tue Oct 28 21:34:02 2008
New Revision: 58359

URL: http://llvm.org/viewvc/llvm-project?rev=58359&view=rev
Log:
Rename: AddDecl => BindDecl
BindDecl better describes what the function does:
  - Bind the VarDecl to its memory region
  - Bind the memory region to some initial value.

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/GRExprEngine.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=58359&r1=58358&r2=58359&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Tue Oct 28 21:34:02 2008
@@ -327,8 +327,8 @@
 
   typedef StoreManager::DeadSymbolsTy DeadSymbolsTy;
 
-  const GRState* AddDecl(const GRState* St, const VarDecl* VD, Expr* Ex, 
-                         unsigned Count);
+  const GRState* BindDecl(const GRState* St, const VarDecl* VD, Expr* Ex, 
+                          unsigned Count);
   
   /// BindCompoundLiteral - Return the state that has the bindings currently
   ///  in 'state' plus the bindings for the CompoundLiteral.  'R' is the region

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=58359&r1=58358&r2=58359&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/Store.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/Store.h Tue Oct 28 21:34:02 2008
@@ -87,10 +87,10 @@
                      llvm::SmallVectorImpl<const MemRegion*>& RegionRoots,
                      LiveSymbolsTy& LSymbols, DeadSymbolsTy& DSymbols) = 0;
 
-  virtual Store AddDecl(Store store,
-                        const VarDecl* VD, Expr* Ex, 
-                        SVal InitVal = UndefinedVal(), 
-                        unsigned Count = 0) = 0;
+  virtual Store BindDecl(Store store,
+                         const VarDecl* VD, Expr* Ex, 
+                         SVal InitVal = UndefinedVal(), 
+                         unsigned Count = 0) = 0;
 
   virtual void print(Store store, std::ostream& Out,
                      const char* nl, const char *sep) = 0;

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

==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Tue Oct 28 21:34:02 2008
@@ -74,8 +74,8 @@
 
   void iterBindings(Store store, BindingsHandler& f);
 
-  Store AddDecl(Store store, const VarDecl* VD, Expr* Ex,
-                SVal InitVal = UndefinedVal(), unsigned Count = 0);
+  Store BindDecl(Store store, const VarDecl* VD, Expr* Ex,
+                 SVal InitVal = UndefinedVal(), unsigned Count = 0);
 
   static inline VarBindingsTy GetVarBindings(Store store) {
     return VarBindingsTy(static_cast<const VarBindingsTy::TreeTy*>(store));
@@ -351,10 +351,8 @@
   return St;
 }
 
-Store BasicStoreManager::AddDecl(Store store,
-                                 const VarDecl* VD, Expr* Ex,
-                                 SVal InitVal, unsigned Count) {
-  
+Store BasicStoreManager::BindDecl(Store store, const VarDecl* VD, Expr* Ex,
+                                  SVal InitVal, unsigned Count) {
   BasicValueFactory& BasicVals = StateMgr.getBasicVals();
   SymbolManager& SymMgr = StateMgr.getSymbolManager();
   

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Tue Oct 28 21:34:02 2008
@@ -1608,7 +1608,7 @@
   
   for (NodeSet::iterator I=Tmp.begin(), E=Tmp.end(); I!=E; ++I) {
     const GRState* St = GetState(*I);
-    St = StateMgr.AddDecl(St, VD, Ex, Builder->getCurrentBlockCount());
+    St = StateMgr.BindDecl(St, VD, Ex, Builder->getCurrentBlockCount());
     MakeNode(Dst, DS, *I, St);
   }
 }

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRState.cpp (original)
+++ cfe/trunk/lib/Analysis/GRState.cpp Tue Oct 28 21:34:02 2008
@@ -73,16 +73,15 @@
   return getPersistentState(NewSt);    
 }
 
-const GRState* GRStateManager::AddDecl(const GRState* St, const VarDecl* VD, 
-                                       Expr* Ex, unsigned Count) {
+const GRState* GRStateManager::BindDecl(const GRState* St, const VarDecl* VD, 
+                                        Expr* Ex, unsigned Count) {
   Store OldStore = St->getStore();
   Store NewStore;
 
   if (Ex)
-    NewStore = StoreMgr->AddDecl(OldStore, VD, Ex, 
-                              GetSVal(St, Ex), Count);
+    NewStore = StoreMgr->BindDecl(OldStore, VD, Ex, GetSVal(St, Ex), Count);
   else
-    NewStore = StoreMgr->AddDecl(OldStore, VD, Ex);
+    NewStore = StoreMgr->BindDecl(OldStore, VD, Ex);
                               
   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=58359&r1=58358&r2=58359&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Tue Oct 28 21:34:02 2008
@@ -93,8 +93,8 @@
     return store;
   }
 
-  Store AddDecl(Store store, const VarDecl* VD, Expr* Ex, SVal InitVal, 
-                unsigned Count);
+  Store BindDecl(Store store, const VarDecl* VD, Expr* Ex, SVal InitVal, 
+                 unsigned Count);
 
   static inline RegionBindingsTy GetRegionBindings(Store store) {
    return RegionBindingsTy(static_cast<const RegionBindingsTy::TreeTy*>(store));
@@ -292,9 +292,8 @@
   return St;
 }
 
-Store RegionStoreManager::AddDecl(Store store,
-                                  const VarDecl* VD, Expr* Ex,
-                                  SVal InitVal, unsigned Count) {
+Store RegionStoreManager::BindDecl(Store store, const VarDecl* VD, Expr* Ex,
+                                   SVal InitVal, unsigned Count) {
   BasicValueFactory& BasicVals = StateMgr.getBasicVals();
   SymbolManager& SymMgr = StateMgr.getSymbolManager();
 





More information about the cfe-commits mailing list