From c49b9051f42f53d5fe91e7634483e848fee56aa2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 28 May 2007 00:46:44 +0000 Subject: track whether an error has been emitted. llvm-svn: 39502 --- clang/Basic/Diagnostic.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/Basic') diff --git a/clang/Basic/Diagnostic.cpp b/clang/Basic/Diagnostic.cpp index aa732e300a9..ea175b5bb11 100644 --- a/clang/Basic/Diagnostic.cpp +++ b/clang/Basic/Diagnostic.cpp @@ -57,6 +57,8 @@ Diagnostic::Diagnostic(DiagnosticClient &client) : Client(client) { ErrorOnExtensions = false; // Clear all mappings, setting them to MAP_DEFAULT. memset(DiagMappings, 0, sizeof(DiagMappings)); + + ErrorOccurred = false; } /// isNoteWarningOrExtension - Return true if the unmapped diagnostic level of @@ -126,6 +128,9 @@ void Diagnostic::Report(SourceLocation Pos, unsigned DiagID, if (DiagLevel == Diagnostic::Ignored) return; + if (DiagLevel >= Diagnostic::Error) + ErrorOccurred = true; + // Finally, report it. Client.HandleDiagnostic(DiagLevel, Pos, (diag::kind)DiagID, Strs, NumStrs, Ranges, NumRanges); -- cgit v1.2.3