diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-08-21 22:34:01 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-08-21 22:34:01 +0000 |
commit | bbe8ff48be1728ef145c874d6d99879fac78892f (patch) | |
tree | 6956c27d2bc46d02f54b1362a0bccfb3d3c4d3c6 /lib/Analysis/GRState.cpp | |
parent | dbc933701d20918add13b6a3c9d47ff8c75419cf (diff) |
Move the handling of DeclStmt from GRExprEngine to BasicStoreManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55144 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRState.cpp')
-rw-r--r-- | lib/Analysis/GRState.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp index 1cee484357..f9257274a6 100644 --- a/lib/Analysis/GRState.cpp +++ b/lib/Analysis/GRState.cpp @@ -142,6 +142,24 @@ const GRState* GRStateManager::SetRVal(const GRState* St, LVal LV, return getPersistentState(NewSt); } +const GRState* GRStateManager::AddDecl(const GRState* St, const VarDecl* VD, + Expr* Ex, unsigned Count) { + Store OldStore = St->getStore(); + Store NewStore; + + if (Ex) + NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex, + GetRVal(St, Ex), Count); + else + NewStore = StMgr->AddDecl(OldStore, BasicVals, SymMgr, VD, Ex); + + if (NewStore == OldStore) + return St; + GRState NewSt = *St; + NewSt.St = NewStore; + return getPersistentState(NewSt); +} + const GRState* GRStateManager::Unbind(const GRState* St, LVal LV) { Store OldStore = St->getStore(); Store NewStore = StMgr->Remove(OldStore, LV); |