aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/MemRegion.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-04 02:43:08 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-04 02:43:08 +0000
commit41168eac256fed59ec5406a75fce91c59cd5dd91 (patch)
treefb4c2123aec1baf7a801e74a6c35510eafc23d2e /lib/Analysis/MemRegion.cpp
parentfe133d98fd003db818dcc2a0f0dbf7416a01aaed (diff)
Added the notion of a "boundable region", which is a region that can have a direct binding in the StoreManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemRegion.cpp')
-rw-r--r--lib/Analysis/MemRegion.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp
index f78d937df8..8dd31b54b0 100644
--- a/lib/Analysis/MemRegion.cpp
+++ b/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 << '}';
}