diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-16 04:32:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-16 04:32:54 +0000 |
commit | 2b07d8fe9e8a8ba12d64066632e17a9a5308a12e (patch) | |
tree | 724d42128494efa0ae104574dc1623e0b750bc82 /lib/Basic/Diagnostic.cpp | |
parent | 691f1ae7164ba78c3dd7ac20c487399935b9544b (diff) |
arrange for -Wno-error=foo warnings to be immune to -Werror as
they are supposed to be.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69265 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 19bfeeea72..6b7f732b3f 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -382,7 +382,20 @@ Diagnostic::getDiagnosticLevel(unsigned DiagID, unsigned DiagClass) const { // If warnings are globally mapped to ignore or error, do it. if (IgnoreAllWarnings) return Diagnostic::Ignored; - Result = WarningsAsErrors ? Diagnostic::Error : Diagnostic::Warning; + + Result = Diagnostic::Warning; + if (WarningsAsErrors) + Result = Diagnostic::Error; + break; + case diag::MAP_WARNING_NO_WERROR: + // Diagnostics specified with -Wno-error=foo should be set to warnings, but + // not be adjusted by -Werror or -pedantic-errors. + Result = Diagnostic::Warning; + + // If warnings are globally mapped to ignore or error, do it. + if (IgnoreAllWarnings) + return Diagnostic::Ignored; + break; } |