summaryrefslogtreecommitdiffstats
path: root/clang/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
commitc775712192b4069ea41031276662e1c2e6370e27 (patch)
tree8cb8c32078a2b93b13c201cffacae366af8c8f49 /clang/lib/Analysis/MemRegion.cpp
parent773cdc7c0dd3546ff083a1370b7e3712e5e286be (diff)
downloadbcm5719-llvm-c775712192b4069ea41031276662e1c2e6370e27.tar.gz
bcm5719-llvm-c775712192b4069ea41031276662e1c2e6370e27.zip
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. llvm-svn: 59468
Diffstat (limited to 'clang/lib/Analysis/MemRegion.cpp')
-rw-r--r--clang/lib/Analysis/MemRegion.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Analysis/MemRegion.cpp b/clang/lib/Analysis/MemRegion.cpp
index 4636eaef11f..28a27b048ae 100644
--- a/clang/lib/Analysis/MemRegion.cpp
+++ b/clang/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.");
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud