aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-06 03:57:44 +0000
committerChris Lattner <sabre@nondot.org>2009-02-06 03:57:44 +0000
commit41327585e4937bad8f9db485a506ea45223caeac (patch)
treeb4bd8b80a1b6fcec15cc816a6945f8653f9a150e
parent11e5a7f626ddbc67b6e936ed5184fcdfc7ff274b (diff)
handle fatal errors, rely on warnings to point out missing cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63913 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/PathDiagnostic.cpp3
-rw-r--r--lib/Driver/TextDiagnosticPrinter.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index d25c1b4938..347bc922f3 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/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/lib/Driver/TextDiagnosticPrinter.cpp b/lib/Driver/TextDiagnosticPrinter.cpp
index 39367f0de4..6be362399e 100644
--- a/lib/Driver/TextDiagnosticPrinter.cpp
+++ b/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;