diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-16 07:06:26 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-16 07:06:26 +0000 |
commit | cb529b542a6c473251d15fdd637b3230906ea1dc (patch) | |
tree | a2fc8fa7572ae8741b7eedb67dbe5b30fcb5f816 /lib/Analysis/RegionStore.cpp | |
parent | 5ea7d07ea7d9f2b679c85df7cc45fcc6e157e396 (diff) |
Enhance modularization: return a <state,loc> pair to let GRExprEngine modify the
environment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59407 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r-- | lib/Analysis/RegionStore.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index 732785c0f7..fab2e60538 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -82,8 +82,8 @@ public: SVal ArrayToPointer(SVal Array); - const GRState* CastRegion(const GRState* St, SVal VoidPtr, - QualType CastToTy, Stmt* CastE); + std::pair<const GRState*, SVal> + CastRegion(const GRState* St, SVal VoidPtr, QualType CastToTy, Stmt* CastE); SVal Retrieve(Store S, Loc L, QualType T = QualType()); @@ -264,10 +264,9 @@ SVal RegionStoreManager::ArrayToPointer(SVal Array) { return loc::MemRegionVal(ER); } -const GRState* RegionStoreManager::CastRegion(const GRState* St, - SVal VoidPtr, - QualType CastToTy, - Stmt* CastE) { +std::pair<const GRState*, SVal> +RegionStoreManager::CastRegion(const GRState* St, SVal VoidPtr, + QualType CastToTy, Stmt* CastE) { if (const AllocaRegion* AR = dyn_cast<AllocaRegion>(cast<loc::MemRegionVal>(VoidPtr).getRegion())) { @@ -278,14 +277,13 @@ const GRState* RegionStoreManager::CastRegion(const GRState* St, nonloc::ConcreteInt Idx(getBasicVals().getZeroWithPtrWidth(false)); const ElementRegion* ER = MRMgr.getElementRegion(Idx, TR); - St = StateMgr.BindExpr(St, CastE, loc::MemRegionVal(ER)); - // Add a RegionView to base region. - return AddRegionView(St, TR, AR); + return std::pair<const GRState*, SVal>(AddRegionView(St, TR, AR), + loc::MemRegionVal(ER)); } // Default case. - return St; + return std::pair<const GRState*, SVal>(St, UnknownVal()); } SVal RegionStoreManager::Retrieve(Store S, Loc L, QualType T) { |