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

Ted Kremenek kremenek at apple.com
Fri Aug 22 17:50:56 PDT 2008


Author: kremenek
Date: Fri Aug 22 19:50:55 2008
New Revision: 55213

URL: http://llvm.org/viewvc/llvm-project?rev=55213&view=rev
Log:
Simplify interface to Store::AddDecl

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

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=55213&r1=55212&r2=55213&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/Store.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/Store.h Fri Aug 22 19:50:55 2008
@@ -46,8 +46,8 @@
                                    DeclRootsTy& DRoots, LiveSymbolsTy& LSymbols,                                  
                                    DeadSymbolsTy& DSymbols) = 0;
 
-  virtual Store AddDecl(Store store, BasicValueFactory& BasicVals,
-                        SymbolManager& SymMgr, const VarDecl* VD, Expr* Ex, 
+  virtual Store AddDecl(Store store, GRStateManager& StMgr,
+                        const VarDecl* VD, Expr* Ex, 
                         RVal InitVal = UndefinedVal(), unsigned Count = 0) = 0;
 
   virtual void print(Store store, std::ostream& Out,

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

==============================================================================
--- cfe/trunk/lib/Analysis/BasicStore.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicStore.cpp Fri Aug 22 19:50:55 2008
@@ -41,8 +41,8 @@
                                    DeclRootsTy& DRoots, LiveSymbolsTy& LSymbols,
                                    DeadSymbolsTy& DSymbols);
 
-  virtual Store AddDecl(Store store, BasicValueFactory& BasicVals,
-                        SymbolManager& SymMgr, const VarDecl* VD, Expr* Ex, 
+  virtual Store AddDecl(Store store, GRStateManager& StateMgr,
+                        const VarDecl* VD, Expr* Ex, 
                         RVal InitVal = UndefinedVal(), unsigned Count = 0);
 
   static inline VarBindingsTy GetVarBindings(Store store) {
@@ -243,9 +243,13 @@
   return St;
 }
 
-Store BasicStoreManager::AddDecl(Store store, BasicValueFactory& BasicVals,
-                                 SymbolManager& SymMgr, const VarDecl* VD, 
-                                 Expr* Ex, RVal InitVal, unsigned Count) {
+Store BasicStoreManager::AddDecl(Store store, GRStateManager& StateMgr,
+                                 const VarDecl* VD, Expr* Ex,
+                                 RVal InitVal, unsigned Count) {
+  
+  BasicValueFactory& BasicVals = StateMgr.getBasicVals();
+  SymbolManager& SymMgr = StateMgr.getSymbolManager();
+  
   // BasicStore does not model arrays and structs.
   if (VD->getType()->isArrayType() || VD->getType()->isStructureType())
     return store;

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRState.cpp (original)
+++ cfe/trunk/lib/Analysis/GRState.cpp Fri Aug 22 19:50:55 2008
@@ -148,13 +148,14 @@
   Store NewStore;
 
   if (Ex)
-    NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex, 
+    NewStore = StMgr->AddDecl(OldStore, *this, VD, Ex, 
                               GetRVal(St, Ex), Count);
   else
-    NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex);
+    NewStore = StMgr->AddDecl(OldStore, *this, VD, Ex);
                               
   if (NewStore == OldStore)
     return St;
+  
   GRState NewSt = *St;
   NewSt.St = NewStore;
   return getPersistentState(NewSt);





More information about the cfe-commits mailing list