diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-06-24 22:15:30 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-06-24 22:15:30 +0000 |
commit | 233e913eec6c178ab58d901a212318bae95dbebd (patch) | |
tree | a642f7235d270a8feb9861d48ab371b686e624ee /lib/Analysis | |
parent | 3eb43a0f6211070522e5ea85acfce355b01aba71 (diff) |
Remove GRStateManager::GetSValAsScalarOrLoc()/GetSVal().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74128 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/GRExprEngineInternalChecks.cpp | 3 | ||||
-rw-r--r-- | lib/Analysis/GRState.cpp | 16 |
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/Analysis/GRExprEngineInternalChecks.cpp b/lib/Analysis/GRExprEngineInternalChecks.cpp index 13df89ebbf..76d26dd9f0 100644 --- a/lib/Analysis/GRExprEngineInternalChecks.cpp +++ b/lib/Analysis/GRExprEngineInternalChecks.cpp @@ -672,7 +672,6 @@ public: return NULL; if (!StoreSite) { - GRStateManager &StateMgr = BRC.getStateManager(); const ExplodedNode<GRState> *Node = N, *Last = NULL; for ( ; Node ; Last = Node, Node = Node->getFirstPred()) { @@ -686,7 +685,7 @@ public: } } - if (StateMgr.GetSVal(Node->getState(), R) != V) + if (Node->getState()->getSVal(R) != V) break; } diff --git a/lib/Analysis/GRState.cpp b/lib/Analysis/GRState.cpp index 3217c4ac4d..65db6a29c8 100644 --- a/lib/Analysis/GRState.cpp +++ b/lib/Analysis/GRState.cpp @@ -68,6 +68,22 @@ const GRState *GRState::unbindLoc(Loc LV) const { return Mgr->getPersistentState(NewSt); } +SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const { + // We only want to do fetches from regions that we can actually bind + // values. For example, SymbolicRegions of type 'id<...>' cannot + // have direct bindings (but their can be bindings on their subregions). + if (!R->isBoundable()) + return UnknownVal(); + + if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) { + QualType T = TR->getValueType(Mgr->getContext()); + if (Loc::IsLocType(T) || T->isIntegerType()) + return getSVal(R); + } + + return UnknownVal(); +} + const GRState* GRStateManager::getInitialState() { GRState StateImpl(this, EnvMgr.getInitialEnvironment(), StoreMgr->getInitialStore(), |