[cfe-commits] r67432 - in /cfe/trunk: include/clang/AST/DeclarationName.h lib/AST/DeclarationName.cpp

Chris Lattner sabre at nondot.org
Fri Mar 20 23:40:50 PDT 2009


Author: lattner
Date: Sat Mar 21 01:40:50 2009
New Revision: 67432

URL: http://llvm.org/viewvc/llvm-project?rev=67432&view=rev
Log:
add an assertion for unreachable code.

Modified:
    cfe/trunk/include/clang/AST/DeclarationName.h
    cfe/trunk/lib/AST/DeclarationName.cpp

Modified: cfe/trunk/include/clang/AST/DeclarationName.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclarationName.h?rev=67432&r1=67431&r2=67432&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/DeclarationName.h (original)
+++ cfe/trunk/include/clang/AST/DeclarationName.h Sat Mar 21 01:40:50 2009
@@ -104,16 +104,14 @@
     if (getNameKind() >= CXXConstructorName && 
         getNameKind() <= CXXConversionFunctionName)
       return reinterpret_cast<CXXSpecialName *>(Ptr & ~PtrMask);
-    else
-      return 0;
+    return 0;
   }
 
   /// getAsCXXOperatorIdName
   CXXOperatorIdName *getAsCXXOperatorIdName() const {
     if (getNameKind() == CXXOperatorName)
       return reinterpret_cast<CXXOperatorIdName *>(Ptr & ~PtrMask);
-    else
-      return 0;
+    return 0;
   }
 
   // Construct a declaration name from the name of a C++ constructor,
@@ -177,8 +175,7 @@
   IdentifierInfo *getAsIdentifierInfo() const { 
     if (getNameKind() == Identifier)
       return reinterpret_cast<IdentifierInfo *>(Ptr);
-    else
-      return 0;
+    return 0;
   }
 
   /// getAsOpaqueInteger - Get the representation of this declaration

Modified: cfe/trunk/lib/AST/DeclarationName.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclarationName.cpp?rev=67432&r1=67431&r2=67432&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclarationName.cpp (original)
+++ cfe/trunk/lib/AST/DeclarationName.cpp Sat Mar 21 01:40:50 2009
@@ -113,6 +113,7 @@
   }
 
   // Can't actually get here.
+  assert(0 && "This should be unreachable!");
   return Identifier;
 }
 





More information about the cfe-commits mailing list