]> granicus.if.org Git - clang/commitdiff
handle fatal errors, rely on warnings to point out missing cases.
authorChris Lattner <sabre@nondot.org>
Fri, 6 Feb 2009 03:57:44 +0000 (03:57 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 6 Feb 2009 03:57:44 +0000 (03:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63913 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/PathDiagnostic.cpp
lib/Driver/TextDiagnosticPrinter.cpp

index d25c1b4938f9b54b8a0b05d612db41a62971b1e7..347bc922f349ac7a9cc0ececdc31b958797d93eb 100644 (file)
@@ -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;
index 39367f0de4be2c911c3d47c031afd8e707d0e733..6be362399e9473855f2e22826fb55ffb6cb617c7 100644 (file)
@@ -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;