[cfe-commits] r164824 - /cfe/trunk/lib/Basic/DiagnosticIDs.cpp

Daniel Jasper djasper at google.com
Fri Sep 28 08:45:08 PDT 2012


Author: djasper
Date: Fri Sep 28 10:45:07 2012
New Revision: 164824

URL: http://llvm.org/viewvc/llvm-project?rev=164824&view=rev
Log:
Set Diag.ErrorOccurred even if a DiagnosticConsumer does not want it in
diagnostic count.

If a DiagnosticConsumer sub-class overwrites IncludeInDiagnosticCounts,
this should change diagnostic counts. However, it currently also
influences Diag.ErrorOccurred, which in turn influences the behavior of
parsing and semantic analysis (in a way that can make it crash).

Modified:
    cfe/trunk/lib/Basic/DiagnosticIDs.cpp

Modified: cfe/trunk/lib/Basic/DiagnosticIDs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/DiagnosticIDs.cpp?rev=164824&r1=164823&r2=164824&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/DiagnosticIDs.cpp (original)
+++ cfe/trunk/lib/Basic/DiagnosticIDs.cpp Fri Sep 28 10:45:07 2012
@@ -628,9 +628,9 @@
   if (DiagLevel >= DiagnosticIDs::Error) {
     if (isUnrecoverable(DiagID))
       Diag.UnrecoverableErrorOccurred = true;
-    
+
+    Diag.ErrorOccurred = true;
     if (Diag.Client->IncludeInDiagnosticCounts()) {
-      Diag.ErrorOccurred = true;
       ++Diag.NumErrors;
     }
 
@@ -686,4 +686,3 @@
   unsigned cat = getCategoryNumberForDiag(DiagID);
   return DiagnosticIDs::getCategoryNameFromID(cat).startswith("ARC ");
 }
-





More information about the cfe-commits mailing list