diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-03-30 06:48:56 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-03-30 06:48:56 +0000 |
commit | a45fec1a586a3b234d301bb89e26f2e891def0d7 (patch) | |
tree | 45f124e1a05071a1290e16b67aa6542cc3164fd7 /lib/Analysis/RegionStore.cpp | |
parent | cd8e4c44dd068956e9181381be3ee2d49a0fac52 (diff) |
Make SymbolicRegion untyped.
Layer the type information with a TypedViewRegion on top of the SymbolicRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68028 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r-- | lib/Analysis/RegionStore.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index 60948062f6..0b2d99b29b 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -362,9 +362,13 @@ SVal RegionStoreManager::getLValueFieldOrIvar(const GRState* St, SVal Base, BaseR = cast<loc::MemRegionVal>(BaseL).getRegion(); break; - case loc::SymbolValKind: - BaseR = MRMgr.getSymbolicRegion(cast<loc::SymbolVal>(&BaseL)->getSymbol()); + case loc::SymbolValKind: { + SymbolRef Sym = cast<loc::SymbolVal>(&BaseL)->getSymbol(); + const SymbolicRegion* SR = MRMgr.getSymbolicRegion(Sym); + // Layer the type information. + BaseR = MRMgr.getTypedViewRegion(Sym->getType(getContext()), SR); break; + } case loc::GotoLabelKind: case loc::FuncValKind: @@ -407,9 +411,14 @@ SVal RegionStoreManager::getLValueElement(const GRState* St, const TypedRegion* BaseRegion = 0; - BaseRegion = isa<loc::SymbolVal>(Base) - ? MRMgr.getSymbolicRegion(cast<loc::SymbolVal>(Base).getSymbol()) - : cast<TypedRegion>(cast<loc::MemRegionVal>(Base).getRegion()); + if (isa<loc::SymbolVal>(Base)) { + SymbolRef Sym = cast<loc::SymbolVal>(Base).getSymbol(); + SymbolicRegion* SR = MRMgr.getSymbolicRegion(Sym); + // Layer the type information. + BaseRegion = MRMgr.getTypedViewRegion(Sym->getType(getContext()), SR); + } + else + BaseRegion = cast<TypedRegion>(cast<loc::MemRegionVal>(Base).getRegion()); // Pointer of any type can be cast and used as array base. const ElementRegion *ElemR = dyn_cast<ElementRegion>(BaseRegion); |