diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-06-27 00:24:54 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-06-27 00:24:54 +0000 |
commit | 8e5f6951ebdc1f9d367226d146050bc542941f7a (patch) | |
tree | d5801aa72556a3ac1c476dced399880227e6336d /clang/lib/Analysis/GRState.cpp | |
parent | 1e880602ad7b68eb4ff35acb21b160908c284b52 (diff) | |
download | bcm5719-llvm-8e5f6951ebdc1f9d367226d146050bc542941f7a.tar.gz bcm5719-llvm-8e5f6951ebdc1f9d367226d146050bc542941f7a.zip |
Remove the last 'GetXXX' methods from GRStateManager.
llvm-svn: 74361
Diffstat (limited to 'clang/lib/Analysis/GRState.cpp')
-rw-r--r-- | clang/lib/Analysis/GRState.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/lib/Analysis/GRState.cpp b/clang/lib/Analysis/GRState.cpp index 5ee4e6ff4b7..493edc37bac 100644 --- a/clang/lib/Analysis/GRState.cpp +++ b/clang/lib/Analysis/GRState.cpp @@ -85,6 +85,37 @@ SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const { return UnknownVal(); } + +const GRState *GRState::bindExpr(const Stmt* Ex, SVal V, bool isBlkExpr, + bool Invalidate) const { + + Environment NewEnv = Mgr->EnvMgr.BindExpr(Env, Ex, V, isBlkExpr, Invalidate); + + if (NewEnv == Env) + return this; + + GRState NewSt = *this; + NewSt.Env = NewEnv; + return Mgr->getPersistentState(NewSt); +} + +const GRState *GRState::bindExpr(const Stmt* Ex, SVal V, + bool Invalidate) const { + + bool isBlkExpr = false; + + if (Ex == Mgr->CurrentStmt) { + // FIXME: Should this just be an assertion? When would we want to set + // the value of a block-level expression if it wasn't CurrentStmt? + isBlkExpr = Mgr->cfg.isBlkExpr(Ex); + + if (!isBlkExpr) + return this; + } + + return bindExpr(Ex, V, isBlkExpr, Invalidate); +} + const GRState* GRStateManager::getInitialState() { GRState StateImpl(this, EnvMgr.getInitialEnvironment(), StoreMgr->getInitialStore(), |