From 628ae879eae46475ad6ad5a717fab9185f354ebf Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Wed, 29 Oct 2008 02:34:02 +0000 Subject: [PATCH] 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. llvm-svn: 58359 --- clang/include/clang/Analysis/PathSensitive/GRState.h | 4 ++-- clang/include/clang/Analysis/PathSensitive/Store.h | 8 ++++---- clang/lib/Analysis/BasicStore.cpp | 10 ++++------ clang/lib/Analysis/GRExprEngine.cpp | 2 +- clang/lib/Analysis/GRState.cpp | 9 ++++----- clang/lib/Analysis/RegionStore.cpp | 9 ++++----- 6 files changed, 19 insertions(+), 23 deletions(-) diff --git a/clang/include/clang/Analysis/PathSensitive/GRState.h b/clang/include/clang/Analysis/PathSensitive/GRState.h index 265d028e8aca..5d91b2fa613f 100644 --- a/clang/include/clang/Analysis/PathSensitive/GRState.h +++ b/clang/include/clang/Analysis/PathSensitive/GRState.h @@ -327,8 +327,8 @@ public: 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 diff --git a/clang/include/clang/Analysis/PathSensitive/Store.h b/clang/include/clang/Analysis/PathSensitive/Store.h index 41464c176fe7..4c08fe6dd390 100644 --- a/clang/include/clang/Analysis/PathSensitive/Store.h +++ b/clang/include/clang/Analysis/PathSensitive/Store.h @@ -87,10 +87,10 @@ public: llvm::SmallVectorImpl& 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; diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp index 05c8523d2dc2..de5ff30db9fd 100644 --- a/clang/lib/Analysis/BasicStore.cpp +++ b/clang/lib/Analysis/BasicStore.cpp @@ -74,8 +74,8 @@ public: 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(store)); @@ -351,10 +351,8 @@ Store BasicStoreManager::getInitialStore() { 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(); diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp index bbeebd6858a9..a9303330feee 100644 --- a/clang/lib/Analysis/GRExprEngine.cpp +++ b/clang/lib/Analysis/GRExprEngine.cpp @@ -1608,7 +1608,7 @@ void GRExprEngine::VisitDeclStmt(DeclStmt* DS, NodeTy* Pred, NodeSet& Dst) { 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); } } diff --git a/clang/lib/Analysis/GRState.cpp b/clang/lib/Analysis/GRState.cpp index 03b724779e9d..f598ec4b7035 100644 --- a/clang/lib/Analysis/GRState.cpp +++ b/clang/lib/Analysis/GRState.cpp @@ -73,16 +73,15 @@ const GRState* GRStateManager::SetSVal(const GRState* St, Loc LV, 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; diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 1c73ceae202c..d5fb4d2a9af8 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/lib/Analysis/RegionStore.cpp @@ -93,8 +93,8 @@ public: 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(store)); @@ -292,9 +292,8 @@ Store RegionStoreManager::getInitialStore() { 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();