From ec7e7dfe0a254ec628c685934b95cbd4f74a08d2 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Fri, 3 Apr 2009 07:33:13 +0000 Subject: 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 --- clang/lib/Analysis/BasicStore.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'clang/lib/Analysis/BasicStore.cpp') 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(R)); + if (const SymbolicRegion* SR = dyn_cast(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(VD) || isa(VD)) - ? SVal::GetRValueSymbolVal(StateMgr.getSymbolManager(), R) + ? SVal::GetRValueSymbolVal(StateMgr.getSymbolManager(), MRMgr,R) : UndefinedVal(); St = BindInternal(St, Loc::MakeVal(R), X); -- cgit v1.2.3