diff options
| author | Ted Kremenek <kremenek@apple.com> | 2008-08-23 00:50:55 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2008-08-23 00:50:55 +0000 |
| commit | 4e7713c04d24f38a5d27050b149ab12249eeb4d7 (patch) | |
| tree | 5ee27b35ae8d4c30026d3130f5d718dc49ffb360 /clang/lib/Analysis | |
| parent | ac37f9a9bed46eb009425e012709fc55916317b4 (diff) | |
| download | bcm5719-llvm-4e7713c04d24f38a5d27050b149ab12249eeb4d7.tar.gz bcm5719-llvm-4e7713c04d24f38a5d27050b149ab12249eeb4d7.zip | |
Simplify interface to Store::AddDecl
llvm-svn: 55213
Diffstat (limited to 'clang/lib/Analysis')
| -rw-r--r-- | clang/lib/Analysis/BasicStore.cpp | 14 | ||||
| -rw-r--r-- | clang/lib/Analysis/GRState.cpp | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp index ad0e12aa4c1..2ed89c6f7d4 100644 --- a/clang/lib/Analysis/BasicStore.cpp +++ b/clang/lib/Analysis/BasicStore.cpp @@ -41,8 +41,8 @@ public: 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 @@ Store BasicStoreManager::getInitialStore(GRStateManager& StateMgr) { 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; diff --git a/clang/lib/Analysis/GRState.cpp b/clang/lib/Analysis/GRState.cpp index f9257274a6a..f1e07907fd1 100644 --- a/clang/lib/Analysis/GRState.cpp +++ b/clang/lib/Analysis/GRState.cpp @@ -148,13 +148,14 @@ const GRState* GRStateManager::AddDecl(const GRState* St, const VarDecl* VD, 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); |

