]> granicus.if.org Git - clang/commitdiff
Fold assertion into second valid else branch. This removes a compiler warning
authorTed Kremenek <kremenek@apple.com>
Mon, 17 Nov 2008 22:55:12 +0000 (22:55 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 17 Nov 2008 22:55:12 +0000 (22:55 +0000)
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

lib/Analysis/MemRegion.cpp

index 4636eaef11f15adfdf967294aa73b69c74480c73..28a27b048ae123848c8d8f76bb710b481a9ad87c 100644 (file)
@@ -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.");
 }
 
 //===----------------------------------------------------------------------===//