From a5c42e9f2a5149e1384f8f33e7d1c248fddeefff Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Sat, 1 Sep 2012 00:13:24 +0000 Subject: [PATCH] Changed the remaining dead asserts to llvm_unreachable. llvm-svn: 163039 --- clang/lib/Sema/SemaDecl.cpp | 12 +++++------- clang/lib/Sema/SemaDeclCXX.cpp | 12 +++++------- clang/lib/Sema/SemaType.cpp | 12 +++++------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 93e07bef622f..2582e132482b 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -8217,15 +8217,13 @@ bool Sema::CheckEnumRedeclaration(SourceLocation EnumLoc, bool IsScoped, /// WARNING: Indexes apply to particular diagnostics only! /// /// \returns diagnostic %select index. -static unsigned getRedeclDiagFromTagKind(TagTypeKind Tag) -{ +static unsigned getRedeclDiagFromTagKind(TagTypeKind Tag) { switch (Tag) { - case TTK_Struct: return 0; - case TTK_Interface: return 1; - case TTK_Class: return 2; - default: assert("Invalid tag kind for redecl diagnostic!"); + case TTK_Struct: return 0; + case TTK_Interface: return 1; + case TTK_Class: return 2; + default: llvm_unreachable("Invalid tag kind for redecl diagnostic!"); } - return -1; } /// \brief Determine if tag kind is a class-key compatible with diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index ff1cbd14b6ab..2a221d8e5d57 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -680,15 +680,13 @@ static bool CheckConstexprParameterTypes(Sema &SemaRef, /// WARNING: Indexes apply to particular diagnostics only! /// /// \returns diagnostic %select index. -static unsigned getRecordDiagFromTagKind(TagTypeKind Tag) -{ +static unsigned getRecordDiagFromTagKind(TagTypeKind Tag) { switch (Tag) { - case TTK_Struct: return 0; - case TTK_Interface: return 1; - case TTK_Class: return 2; - default: assert("Invalid tag kind for record diagnostic!"); + case TTK_Struct: return 0; + case TTK_Interface: return 1; + case TTK_Class: return 2; + default: llvm_unreachable("Invalid tag kind for record diagnostic!"); } - return -1; } // CheckConstexprFunctionDecl - Check whether a function declaration satisfies diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 0935e2e2e00a..82dccfa5f442 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -4437,15 +4437,13 @@ bool Sema::RequireCompleteType(SourceLocation Loc, QualType T, /// WARNING: Indexes apply to particular diagnostics only! /// /// \returns diagnostic %select index. -static unsigned getLiteralDiagFromTagKind(TagTypeKind Tag) -{ +static unsigned getLiteralDiagFromTagKind(TagTypeKind Tag) { switch (Tag) { - case TTK_Struct: return 0; - case TTK_Interface: return 1; - case TTK_Class: return 2; - default: assert("Invalid tag kind for literal type diagnostic!"); + case TTK_Struct: return 0; + case TTK_Interface: return 1; + case TTK_Class: return 2; + default: llvm_unreachable("Invalid tag kind for literal type diagnostic!"); } - return -1; } /// @brief Ensure that the type T is a literal type.