forked from OSchip/llvm-project
parent
9358c715da
commit
c49b9051f4
|
@ -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);
|
||||
|
|
|
@ -55,6 +55,10 @@ class Diagnostic {
|
|||
/// DiagMappings - Mapping information for diagnostics. Mapping info is
|
||||
/// packed into two bits per diagnostic.
|
||||
unsigned char DiagMappings[(diag::NUM_DIAGNOSTICS+3)/4];
|
||||
|
||||
/// ErrorOccurred - This is set to true when an error is emitted, and is
|
||||
/// sticky.
|
||||
bool ErrorOccurred;
|
||||
public:
|
||||
explicit Diagnostic(DiagnosticClient &client);
|
||||
|
||||
|
@ -93,6 +97,7 @@ public:
|
|||
return (diag::Mapping)((DiagMappings[Diag/4] >> (Diag & 3)*2) & 3);
|
||||
}
|
||||
|
||||
bool hasErrorOccurred() const { return ErrorOccurred; }
|
||||
|
||||
//===--------------------------------------------------------------------===//
|
||||
// Diagnostic classification and reporting interfaces.
|
||||
|
|
Loading…
Reference in New Issue