]> granicus.if.org Git - clang/commitdiff
Changed the remaining dead asserts to llvm_unreachable.
authorJoao Matos <ripzonetriton@gmail.com>
Sat, 1 Sep 2012 00:13:24 +0000 (00:13 +0000)
committerJoao Matos <ripzonetriton@gmail.com>
Sat, 1 Sep 2012 00:13:24 +0000 (00:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163039 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaType.cpp

index 93e07bef622f77ffe86ec5cd073a90623eb8af73..2582e132482b0b085cbf5796023a55986ba0a857 100644 (file)
@@ -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
index ff1cbd14b6ab34a78a5f8150e87f4b266008ce6b..2a221d8e5d57f8f7ffe75728e7d7feee79093f1f 100644 (file)
@@ -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
index 0935e2e2e00aaf1c8de65fa6777fdb6a014465b9..82dccfa5f442f9993ddd38782aa1e4b5c2206229 100644 (file)
@@ -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.