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 | f9150bac01dbfb3e399a1e115a66a325683e059c (patch) | |
tree | 055faa79b183e95511d27b630f1ce935fce9f95d /clang/lib | |
parent | 411c0ffe5d96f5e2e5609ad643f81bd2c7fe5d45 (diff) | |
download | bcm5719-llvm-f9150bac01dbfb3e399a1e115a66a325683e059c.tar.gz bcm5719-llvm-f9150bac01dbfb3e399a1e115a66a325683e059c.zip |
arrange for -Wno-error=foo warnings to be immune to -Werror as
they are supposed to be.
llvm-svn: 69265
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Basic/Diagnostic.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 19bfeeea72a..6b7f732b3f0 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/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; } |