aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/MemRegion.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-11-17 22:55:12 +0000
committerTed Kremenek <kremenek@apple.com>2008-11-17 22:55:12 +0000
commit34265e7133ad82148aa9b3ac097ed66728f4ff85 (patch)
treec11a2a06cc5aae3260e67fb6c2c7af03ea569a17 /lib/Analysis/MemRegion.cpp
parent87d3ef08d892df8264bd51adb6ddd4a22422cd29 (diff)
Fold assertion into second valid else branch. This removes a compiler warning
where the control reaches the end of a non-void function and also allows the compiler to generate better code. When this assertion is false we can easily add more else cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/MemRegion.cpp')
-rw-r--r--lib/Analysis/MemRegion.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Analysis/MemRegion.cpp b/lib/Analysis/MemRegion.cpp
index 4636eaef11..28a27b048a 100644
--- a/lib/Analysis/MemRegion.cpp
+++ b/lib/Analysis/MemRegion.cpp
@@ -117,13 +117,12 @@ QualType ElementRegion::getType(ASTContext& C) const {
ArrayType* AT = cast<ArrayType>(T.getTypePtr());
return AT->getElementType();
}
- else if (isa<AnonTypedRegion>(superRegion)) {
+ else {
+ assert (isa<AnonTypedRegion>(superRegion));
PointerType* PtrT = cast<PointerType>(T.getTypePtr());
QualType PTy = PtrT->getPointeeType();
return C.getCanonicalType(PTy);
}
- else
- assert(0 && "SuperRegion type unsupported.");
}
//===----------------------------------------------------------------------===//