aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/BasicStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2009-04-03 07:33:13 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2009-04-03 07:33:13 +0000
commita1718c78770db93d1b762620f07728a56786f2ae (patch)
tree70d070d73cada56167a7100ceaa5f6c99dc076c4 /lib/Analysis/BasicStore.cpp
parent6d7d8398e71a8bd121d3b46e250f1dbcfb9679d4 (diff)
This is the first step to gradually remove the use of loc::SymbolVal. Now
when creating symbolic values, we distinguish between location and non-location values. For location values, we create a symbolic region instead of a loc::SymbolVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/BasicStore.cpp')
-rw-r--r--lib/Analysis/BasicStore.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index 28a5b98fc4..c1efb983c0 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/lib/Analysis/BasicStore.cpp
@@ -125,6 +125,9 @@ public:
}
void print(Store store, std::ostream& Out, const char* nl, const char *sep);
+
+private:
+ ASTContext& getContext() { return StateMgr.getContext(); }
};
} // end anonymous namespace
@@ -273,9 +276,10 @@ SVal BasicStoreManager::getLValueElement(const GRState* St, SVal Base,
break;
}
- // FIXME: Handle SymbolRegions? Shouldn't be possible in
- // BasicStoreManager.
- assert(!isa<SymbolicRegion>(R));
+ if (const SymbolicRegion* SR = dyn_cast<SymbolicRegion>(R)) {
+ SymbolRef Sym = SR->getSymbol();
+ BaseR = MRMgr.getTypedViewRegion(Sym->getType(getContext()), SR);
+ }
break;
}
@@ -477,7 +481,7 @@ Store BasicStoreManager::scanForIvars(Stmt *B, const Decl* SelfDecl, Store St) {
SelfRegion);
SVal X = SVal::GetRValueSymbolVal(StateMgr.getSymbolManager(),
- IVR);
+ MRMgr, IVR);
St = BindInternal(St, Loc::MakeVal(IVR), X);
}
@@ -534,7 +538,7 @@ Store BasicStoreManager::getInitialStore() {
const MemRegion *R = StateMgr.getRegion(VD);
SVal X = (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD) ||
isa<ImplicitParamDecl>(VD))
- ? SVal::GetRValueSymbolVal(StateMgr.getSymbolManager(), R)
+ ? SVal::GetRValueSymbolVal(StateMgr.getSymbolManager(), MRMgr,R)
: UndefinedVal();
St = BindInternal(St, Loc::MakeVal(R), X);