diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-04 02:43:08 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-04 02:43:08 +0000 |
commit | d275bf3c5410cb9c1769d5a34a534dcd3dbcab72 (patch) | |
tree | 9ed63ec4239711eaf8e33e97ff4fe2d5ba00db7a /clang/lib/Analysis/MemRegion.cpp | |
parent | fe8d71f42aeef22a396cc4bd86e00ca329ce925d (diff) | |
download | bcm5719-llvm-d275bf3c5410cb9c1769d5a34a534dcd3dbcab72.tar.gz bcm5719-llvm-d275bf3c5410cb9c1769d5a34a534dcd3dbcab72.zip |
Added the notion of a "boundable region", which is a region that can have a direct binding in the StoreManager.
llvm-svn: 66005
Diffstat (limited to 'clang/lib/Analysis/MemRegion.cpp')
-rw-r--r-- | clang/lib/Analysis/MemRegion.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/clang/lib/Analysis/MemRegion.cpp b/clang/lib/Analysis/MemRegion.cpp index f78d937df82..8dd31b54b0b 100644 --- a/clang/lib/Analysis/MemRegion.cpp +++ b/clang/lib/Analysis/MemRegion.cpp @@ -117,12 +117,22 @@ QualType SymbolicRegion::getRValueType(ASTContext& C) const { // Get the type of the symbol. QualType T = data.getType(C); - // Only when the symbol has pointer type it can have a symbolic region - // associated with it. - PointerType* PTy = cast<PointerType>(T.getTypePtr()->getDesugaredType()); + if (const PointerType* PTy = T->getAsPointerType()) + return PTy->getPointeeType(); + + if (const BlockPointerType* PTy = T->getAsBlockPointerType()) + return PTy->getPointeeType(); - // The type of the symbolic region is the pointee type of the symbol. - return PTy->getPointeeType(); + assert(!T->getAsObjCQualifiedIdType() && + "There is no rvalue type for id<...>"); + + assert(Loc::IsLocType(T) && "Non-location type."); + return QualType(); +} + +QualType SymbolicRegion::getLValueType(ASTContext& C) const { + const SymbolData& data = SymMgr.getSymbolData(sym); + return data.getType(C); } QualType ElementRegion::getRValueType(ASTContext& C) const { @@ -161,7 +171,7 @@ void AllocaRegion::print(llvm::raw_ostream& os) const { } void TypedViewRegion::print(llvm::raw_ostream& os) const { - os << "anon_type{" << T.getAsString() << ','; + os << "typed_view{" << T.getAsString() << ','; getSuperRegion()->print(os); os << '}'; } |