diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-21 06:40:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-21 06:40:50 +0000 |
commit | ac8d75fe94f2aefde5179d53e230b99a1fe1201a (patch) | |
tree | 59bfe9a1eb29ab04d758874af08a51aa76d95ce0 | |
parent | c50689bd1e8788a7fc8f19070b7505ff95034979 (diff) |
add an assertion for unreachable code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67432 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/AST/DeclarationName.h | 9 | ||||
-rw-r--r-- | lib/AST/DeclarationName.cpp | 1 |
2 files changed, 4 insertions, 6 deletions
diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h index 77e5024e37..d1cd4ebc95 100644 --- a/include/clang/AST/DeclarationName.h +++ b/include/clang/AST/DeclarationName.h @@ -104,16 +104,14 @@ private: 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 @@ public: IdentifierInfo *getAsIdentifierInfo() const { if (getNameKind() == Identifier) return reinterpret_cast<IdentifierInfo *>(Ptr); - else - return 0; + return 0; } /// getAsOpaqueInteger - Get the representation of this declaration diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp index 3815a08a65..e2ed892595 100644 --- a/lib/AST/DeclarationName.cpp +++ b/lib/AST/DeclarationName.cpp @@ -113,6 +113,7 @@ DeclarationName::NameKind DeclarationName::getNameKind() const { } // Can't actually get here. + assert(0 && "This should be unreachable!"); return Identifier; } |