From b05f49e7fdaf3bb78e6b77a2fa005d9b57ff28f2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 6 Feb 2009 03:57:44 +0000 Subject: [PATCH] handle fatal errors, rely on warnings to point out missing cases. llvm-svn: 63913 --- clang/lib/Analysis/PathDiagnostic.cpp | 3 ++- clang/lib/Driver/TextDiagnosticPrinter.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/clang/lib/Analysis/PathDiagnostic.cpp b/clang/lib/Analysis/PathDiagnostic.cpp index d25c1b4938f9..347bc922f349 100644 --- a/clang/lib/Analysis/PathDiagnostic.cpp +++ b/clang/lib/Analysis/PathDiagnostic.cpp @@ -29,10 +29,11 @@ void PathDiagnosticClient::HandleDiagnostic(Diagnostic::Level DiagLevel, const char *LevelStr; switch (DiagLevel) { - default: assert(0 && "Unknown diagnostic type!"); + case Diagnostic::Ignored: assert(0 && "Invalid diagnostic type"); case Diagnostic::Note: LevelStr = "note: "; break; case Diagnostic::Warning: LevelStr = "warning: "; break; case Diagnostic::Error: LevelStr = "error: "; break; + case Diagnostic::Fatal: LevelStr = "fatal error: "; break; } llvm::SmallString<100> StrC; diff --git a/clang/lib/Driver/TextDiagnosticPrinter.cpp b/clang/lib/Driver/TextDiagnosticPrinter.cpp index 39367f0de4be..6be362399e94 100644 --- a/clang/lib/Driver/TextDiagnosticPrinter.cpp +++ b/clang/lib/Driver/TextDiagnosticPrinter.cpp @@ -122,10 +122,11 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, } switch (Level) { - default: assert(0 && "Unknown diagnostic type!"); + case Diagnostic::Ignored: assert(0 && "Invalid diagnostic type"); case Diagnostic::Note: OS << "note: "; break; case Diagnostic::Warning: OS << "warning: "; break; case Diagnostic::Error: OS << "error: "; break; + case Diagnostic::Fatal: OS << "fatal error: "; break; } llvm::SmallString<100> OutStr;