diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-22 23:12:53 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-22 23:12:53 +0000 |
commit | e663c720063fc9ff9f75bcbe38cd070c73c78b0e (patch) | |
tree | de135bc38ba7d91185fad60e97c242e9aa1aac09 /lib/Basic | |
parent | 20b4a58e52756266ef029146f1600c45d3d7272a (diff) |
implement -W[no-]fatal-errors, patch by Christian Adåker!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 8d0d81326d..4351f66be3 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -203,6 +203,7 @@ Diagnostic::Diagnostic(DiagnosticClient *client) : Client(client) { AllExtensionsSilenced = 0; IgnoreAllWarnings = false; WarningsAsErrors = false; + ErrorsAsFatal = false; SuppressSystemWarnings = false; SuppressAllDiagnostics = false; ExtBehavior = Ext_Ignore; @@ -326,9 +327,13 @@ Diagnostic::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass) const { return Diagnostic::Ignored; Result = Diagnostic::Warning; if (ExtBehavior == Ext_Error) Result = Diagnostic::Error; + if (Result == Diagnostic::Error && ErrorsAsFatal) + Result = Diagnostic::Fatal; break; case diag::MAP_ERROR: Result = Diagnostic::Error; + if (ErrorsAsFatal) + Result = Diagnostic::Fatal; break; case diag::MAP_FATAL: Result = Diagnostic::Fatal; @@ -349,6 +354,8 @@ Diagnostic::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass) const { if (WarningsAsErrors) Result = Diagnostic::Error; + if (Result == Diagnostic::Error && ErrorsAsFatal) + Result = Diagnostic::Fatal; break; case diag::MAP_WARNING_NO_WERROR: @@ -361,6 +368,12 @@ Diagnostic::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass) const { return Diagnostic::Ignored; break; + + case diag::MAP_ERROR_NO_WFATAL: + // Diagnostics specified as -Wno-fatal-error=foo should be errors, but + // unaffected by -Wfatal-errors. + Result = Diagnostic::Error; + break; } // Okay, we're about to return this as a "diagnostic to emit" one last check: |