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 | 5415b207e34a0673b5fca4ab4c7535e5b8d5c0d4 (patch) | |
| tree | f0e99747dca6010f0e0b115596b212db51be411d /clang/lib/Analysis/RegionStore.cpp | |
| parent | d67a32252c736d496ed12f173a81303f77b44e1a (diff) | |
| download | bcm5719-llvm-5415b207e34a0673b5fca4ab4c7535e5b8d5c0d4.tar.gz bcm5719-llvm-5415b207e34a0673b5fca4ab4c7535e5b8d5c0d4.zip | |
Make SymbolicRegion untyped.
Layer the type information with a TypedViewRegion on top of the SymbolicRegion.
llvm-svn: 68028
Diffstat (limited to 'clang/lib/Analysis/RegionStore.cpp')
| -rw-r--r-- | clang/lib/Analysis/RegionStore.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 60948062f6f..0b2d99b29b1 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/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); |

