[cfe-commits] r59468 - /cfe/trunk/lib/Analysis/MemRegion.cpp

Ted Kremenek kremenek at apple.com
Mon Nov 17 14:55:14 PST 2008


Author: kremenek
Date: Mon Nov 17 16:55:12 2008
New Revision: 59468

URL: http://llvm.org/viewvc/llvm-project?rev=59468&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Analysis/MemRegion.cpp

Modified: cfe/trunk/lib/Analysis/MemRegion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/MemRegion.cpp?rev=59468&r1=59467&r2=59468&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/MemRegion.cpp (original)
+++ cfe/trunk/lib/Analysis/MemRegion.cpp Mon Nov 17 16:55:12 2008
@@ -117,13 +117,12 @@
     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.");
 }
 
 //===----------------------------------------------------------------------===//





More information about the cfe-commits mailing list