Switch assert(0/false) llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp
index 6412727..70baf74 100644
--- a/lib/Frontend/ASTConsumers.cpp
+++ b/lib/Frontend/ASTConsumers.cpp
@@ -286,7 +286,7 @@
}
default:
- assert(0 && "a decl that inherits DeclContext isn't handled");
+ llvm_unreachable("a decl that inherits DeclContext isn't handled");
}
Out << "\n";
@@ -392,7 +392,7 @@
}
default:
Out << "DeclKind: " << DK << '"' << *I << "\"\n";
- assert(0 && "decl unhandled");
+ llvm_unreachable("decl unhandled");
}
}
}
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index e699261..03d06e6 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -1164,7 +1164,7 @@
if (const Arg *A = Args.getLastArg(OPT_Action_Group)) {
switch (A->getOption().getID()) {
default:
- assert(0 && "Invalid option in group!");
+ llvm_unreachable("Invalid option in group!");
case OPT_ast_dump:
Opts.ProgramAction = frontend::ASTDump; break;
case OPT_ast_dump_xml:
@@ -1457,7 +1457,7 @@
case IK_None:
case IK_AST:
case IK_LLVM_IR:
- assert(0 && "Invalid input kind!");
+ llvm_unreachable("Invalid input kind!");
case IK_OpenCL:
LangStd = LangStandard::lang_opencl;
break;
diff --git a/lib/Frontend/TextDiagnosticBuffer.cpp b/lib/Frontend/TextDiagnosticBuffer.cpp
index 069c86d..c03ac54 100644
--- a/lib/Frontend/TextDiagnosticBuffer.cpp
+++ b/lib/Frontend/TextDiagnosticBuffer.cpp
@@ -26,7 +26,8 @@
llvm::SmallString<100> Buf;
Info.FormatDiagnostic(Buf);
switch (Level) {
- default: assert(0 && "Diagnostic not handled during diagnostic buffering!");
+ default: llvm_unreachable(
+ "Diagnostic not handled during diagnostic buffering!");
case Diagnostic::Note:
Notes.push_back(std::make_pair(Info.getLocation(), Buf.str()));
break;
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp
index 4fc6949..762a7c5 100644
--- a/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -1083,7 +1083,7 @@
if (DiagOpts->ShowColors) {
// Print diagnostic category in bold and color
switch (Level) {
- case Diagnostic::Ignored: assert(0 && "Invalid diagnostic type");
+ case Diagnostic::Ignored: llvm_unreachable("Invalid diagnostic type");
case Diagnostic::Note: OS.changeColor(noteColor, true); break;
case Diagnostic::Warning: OS.changeColor(warningColor, true); break;
case Diagnostic::Error: OS.changeColor(errorColor, true); break;
@@ -1092,7 +1092,7 @@
}
switch (Level) {
- case Diagnostic::Ignored: assert(0 && "Invalid diagnostic type");
+ case Diagnostic::Ignored: llvm_unreachable("Invalid diagnostic type");
case Diagnostic::Note: OS << "note: "; break;
case Diagnostic::Warning: OS << "warning: "; break;
case Diagnostic::Error: OS << "error: "; break;