diff options
author | David Blaikie <dblaikie@gmail.com> | 2011-09-23 05:06:16 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2011-09-23 05:06:16 +0000 |
commit | b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 (patch) | |
tree | 2b708dc00bedcc6a6204d29c915ac7fce8fb028f /lib/AST/DeclBase.cpp | |
parent | c535d9730e11ca335790359bfbd4600be71c5410 (diff) |
Switch assert(0/false) llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 68cf82edc4..d1f8b1c7fd 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -43,7 +43,7 @@ static bool StatSwitch = false; const char *Decl::getDeclKindName() const { switch (DeclKind) { - default: assert(0 && "Declaration not in DeclNodes.inc!"); + default: llvm_unreachable("Declaration not in DeclNodes.inc!"); #define DECL(DERIVED, BASE) case DERIVED: return #DERIVED; #define ABSTRACT_DECL(DECL) #include "clang/AST/DeclNodes.inc" @@ -62,7 +62,7 @@ void Decl::setInvalidDecl(bool Invalid) { const char *DeclContext::getDeclKindName() const { switch (DeclKind) { - default: assert(0 && "Declaration context not in DeclNodes.inc!"); + default: llvm_unreachable("Declaration context not in DeclNodes.inc!"); #define DECL(DERIVED, BASE) case Decl::DERIVED: return #DERIVED; #define ABSTRACT_DECL(DECL) #include "clang/AST/DeclNodes.inc" @@ -100,7 +100,7 @@ void Decl::PrintStats() { void Decl::add(Kind k) { switch (k) { - default: assert(0 && "Declaration not in DeclNodes.inc!"); + default: llvm_unreachable("Declaration not in DeclNodes.inc!"); #define DECL(DERIVED, BASE) case DERIVED: ++n##DERIVED##s; break; #define ABSTRACT_DECL(DECL) #include "clang/AST/DeclNodes.inc" @@ -571,7 +571,7 @@ Decl *Decl::castFromDeclContext (const DeclContext *D) { if (DK >= first##NAME && DK <= last##NAME) \ return static_cast<NAME##Decl*>(const_cast<DeclContext*>(D)); #include "clang/AST/DeclNodes.inc" - assert(false && "a decl that inherits DeclContext isn't handled"); + llvm_unreachable("a decl that inherits DeclContext isn't handled"); return 0; } } @@ -591,7 +591,7 @@ DeclContext *Decl::castToDeclContext(const Decl *D) { if (DK >= first##NAME && DK <= last##NAME) \ return static_cast<NAME##Decl*>(const_cast<Decl*>(D)); #include "clang/AST/DeclNodes.inc" - assert(false && "a decl that inherits DeclContext isn't handled"); + llvm_unreachable("a decl that inherits DeclContext isn't handled"); return 0; } } |