diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-05 22:47:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-05 22:47:05 +0000 |
commit | da0cbc1ad4a553c4de111c1181ec7b42c5ddefce (patch) | |
tree | cb2fd50b55fcab8cb896c12b041f96e95c43e6df /lib/Basic/Diagnostic.cpp | |
parent | a92206ea578983f86fbf1246702955a10056dff8 (diff) |
add support to the diagnostics machinery for mapping warnings and
errors to 'fatal' error severity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 2429bddfeb..ae23278f6c 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -33,6 +33,7 @@ enum { EXTENSION = 0x03, EXTWARN = 0x04, ERROR = 0x05, + FATAL = 0x06, class_mask = 0x07 }; @@ -259,7 +260,10 @@ Diagnostic::Level Diagnostic::getDiagnosticLevel(unsigned DiagID) const { case diag::MAP_IGNORE: return Diagnostic::Ignored; case diag::MAP_WARNING: DiagClass = WARNING; break; case diag::MAP_ERROR: DiagClass = ERROR; break; + case diag::MAP_FATAL: DiagClass = FATAL; break; } + } else if (getDiagnosticMapping((diag::kind)DiagID) == diag::MAP_FATAL) { + DiagClass = FATAL; } // Map diagnostic classes based on command line argument settings. @@ -287,6 +291,7 @@ Diagnostic::Level Diagnostic::getDiagnosticLevel(unsigned DiagID) const { case NOTE: return Diagnostic::Note; case WARNING: return Diagnostic::Warning; case ERROR: return Diagnostic::Error; + case FATAL: return Diagnostic::Fatal; } } |