aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BasicStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-01-22 18:23:34 +0000
committerTed Kremenek <kremenek@apple.com>2009-01-22 18:23:34 +0000
commit9ab6b9cfb76ee56a61829e2bdb08e5cdc288726e (patch)
treece8772d0a73edbd6ce7aa138ee9ccc7b6d1bd738 /lib/Analysis/BasicStore.cpp
parent07c487e5f73c3e6ea47a03b674a4a0f753adf90f (diff)
Static analyzer: Remove a bunch of outdated SymbolData objects and
their associated APIs. We no longer need separate SymbolData objects for fields, variables, etc. Instead, we now associated symbols with the "rvalue" of a MemRegion (i.e., the value stored at that region). Now we only have two kinds of SymbolData objects: SymbolRegionRValue and SymbolConjured. This cleanup also makes the distinction between a SymbolicRegion and a symbolic value that is a location much clearer. A SymbolicRegion represents a chunk of symbolic memory, while a symbolic location is just a "pointer" with different possible values. Without any specific knowledge, a symbolic location resolves (i.e., via a dereference) to a SymbolicRegion. In the future, when we do better alias reasoning, a symbolic location can become an alias for another location, thus merging the constraints on the referred SymbolicRegion with the other region. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BasicStore.cpp')
-rw-r--r--lib/Analysis/BasicStore.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index 7315ec71ac..a36a239e0d 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/lib/Analysis/BasicStore.cpp
@@ -454,12 +454,13 @@ Store BasicStoreManager::getInitialStore() {
if (Loc::IsLocType(T) || T->isIntegerType()) {
// Initialize globals and parameters to symbolic values.
// Initialize local variables to undefined.
+ const MemRegion *R = StateMgr.getRegion(VD);
SVal X = (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD) ||
isa<ImplicitParamDecl>(VD))
- ? SVal::GetSymbolValue(StateMgr.getSymbolManager(), VD)
- : UndefinedVal();
+ ? SVal::GetRValueSymbolVal(StateMgr.getSymbolManager(), R)
+ : UndefinedVal();
- St = BindInternal(St, Loc::MakeVal(MRMgr.getVarRegion(VD)), X);
+ St = BindInternal(St, Loc::MakeVal(R), X);
}
}
}