[cfe-commits] r63913 - in /cfe/trunk/lib: Analysis/PathDiagnostic.cpp Driver/TextDiagnosticPrinter.cpp

Chris Lattner sabre at nondot.org
Thu Feb 5 19:57:44 PST 2009


Author: lattner
Date: Thu Feb  5 21:57:44 2009
New Revision: 63913

URL: http://llvm.org/viewvc/llvm-project?rev=63913&view=rev
Log:
handle fatal errors, rely on warnings to point out missing cases.

Modified:
    cfe/trunk/lib/Analysis/PathDiagnostic.cpp
    cfe/trunk/lib/Driver/TextDiagnosticPrinter.cpp

Modified: cfe/trunk/lib/Analysis/PathDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/PathDiagnostic.cpp?rev=63913&r1=63912&r2=63913&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/PathDiagnostic.cpp (original)
+++ cfe/trunk/lib/Analysis/PathDiagnostic.cpp Thu Feb  5 21:57:44 2009
@@ -29,10 +29,11 @@
   
   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;

Modified: cfe/trunk/lib/Driver/TextDiagnosticPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/TextDiagnosticPrinter.cpp?rev=63913&r1=63912&r2=63913&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/TextDiagnosticPrinter.cpp (original)
+++ cfe/trunk/lib/Driver/TextDiagnosticPrinter.cpp Thu Feb  5 21:57:44 2009
@@ -122,10 +122,11 @@
   }
   
   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;





More information about the cfe-commits mailing list