From: Ted Kremenek Date: Mon, 17 Nov 2008 22:55:12 +0000 (+0000) Subject: Fold assertion into second valid else branch. This removes a compiler warning X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34265e7133ad82148aa9b3ac097ed66728f4ff85;p=clang 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 --- 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(T.getTypePtr()); return AT->getElementType(); } - else if (isa(superRegion)) { + else { + assert (isa(superRegion)); PointerType* PtrT = cast(T.getTypePtr()); QualType PTy = PtrT->getPointeeType(); return C.getCanonicalType(PTy); } - else - assert(0 && "SuperRegion type unsupported."); } //===----------------------------------------------------------------------===//