summaryrefslogtreecommitdiffstats
path: root/clang/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
commitec7e7dfe0a254ec628c685934b95cbd4f74a08d2 (patch)
treeda7940176c93a1c1f4b9f6cf710bcd2ff99e7a1c /clang/lib/Analysis/BasicStore.cpp
parent8554a77e8d86b0d5f28d4ff547eaf5cc3b6ef1bd (diff)
downloadbcm5719-llvm-ec7e7dfe0a254ec628c685934b95cbd4f74a08d2.tar.gz
bcm5719-llvm-ec7e7dfe0a254ec628c685934b95cbd4f74a08d2.zip
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. llvm-svn: 68373
Diffstat (limited to 'clang/lib/Analysis/BasicStore.cpp')
-rw-r--r--clang/lib/Analysis/BasicStore.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp
index 28a5b98fc4e..c1efb983c04 100644
--- a/clang/lib/Analysis/BasicStore.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud