diff options
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/ASTConsumers.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 4 | ||||
-rw-r--r-- | lib/Frontend/TextDiagnosticBuffer.cpp | 3 | ||||
-rw-r--r-- | lib/Frontend/TextDiagnosticPrinter.cpp | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index 6412727cd7..70baf74545 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -286,7 +286,7 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, } 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 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, } 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 e699261379..03d06e63d3 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1164,7 +1164,7 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, 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 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK, 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 069c86de13..c03ac54411 100644 --- a/lib/Frontend/TextDiagnosticBuffer.cpp +++ b/lib/Frontend/TextDiagnosticBuffer.cpp @@ -26,7 +26,8 @@ void TextDiagnosticBuffer::HandleDiagnostic(Diagnostic::Level Level, 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 4fc694978c..762a7c528c 100644 --- a/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/lib/Frontend/TextDiagnosticPrinter.cpp @@ -1083,7 +1083,7 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, 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 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, } 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; |