diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-05-28 00:46:44 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-05-28 00:46:44 +0000 |
| commit | c49b9051f42f53d5fe91e7634483e848fee56aa2 (patch) | |
| tree | baa8efefb5c36a4d02fc1accfccf10b3be82c6fa /clang/Basic | |
| parent | 9358c715da5146d299fae6c4fe36f4235919711b (diff) | |
| download | bcm5719-llvm-c49b9051f42f53d5fe91e7634483e848fee56aa2.tar.gz bcm5719-llvm-c49b9051f42f53d5fe91e7634483e848fee56aa2.zip | |
track whether an error has been emitted.
llvm-svn: 39502
Diffstat (limited to 'clang/Basic')
| -rw-r--r-- | clang/Basic/Diagnostic.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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); |

