summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-04-16 04:32:54 +0000
committerChris Lattner <sabre@nondot.org>2009-04-16 04:32:54 +0000
commitf9150bac01dbfb3e399a1e115a66a325683e059c (patch)
tree055faa79b183e95511d27b630f1ce935fce9f95d /clang/lib
parent411c0ffe5d96f5e2e5609ad643f81bd2c7fe5d45 (diff)
downloadbcm5719-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.cpp15
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;
}
OpenPOWER on IntegriCloud