[cfe-commits] r132570 - in /cfe/trunk: include/clang/Basic/DiagnosticFrontendKinds.td lib/Frontend/Warnings.cpp
Matt Beaumont-Gay
matthewbg at google.com
Fri Jun 3 11:30:50 PDT 2011
Author: matthewbg
Date: Fri Jun 3 13:30:50 2011
New Revision: 132570
URL: http://llvm.org/viewvc/llvm-project?rev=132570&view=rev
Log:
Don't warn about -Wno-foo where foo is an unknown warning option. Explicitly
passing -Wunknown-warning-option will re-enable warnings about -Wno-foo.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
cfe/trunk/lib/Frontend/Warnings.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td?rev=132570&r1=132569&r2=132570&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticFrontendKinds.td Fri Jun 3 13:30:50 2011
@@ -281,6 +281,9 @@
def warn_unknown_warning_option : Warning<
"unknown warning option '%0'">,
InGroup<DiagGroup<"unknown-warning-option"> >;
+def warn_unknown_negative_warning_option : Warning<
+ "unknown warning option '%0'">,
+ InGroup<DiagGroup<"unknown-warning-option"> >, DefaultIgnore;
def warn_unknown_warning_specifier : Warning<
"unknown %0 warning specifier: '%1'">,
InGroup<DiagGroup<"unknown-warning-option"> >;
Modified: cfe/trunk/lib/Frontend/Warnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/Warnings.cpp?rev=132570&r1=132569&r2=132570&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/Warnings.cpp (original)
+++ cfe/trunk/lib/Frontend/Warnings.cpp Fri Jun 3 13:30:50 2011
@@ -123,6 +123,8 @@
}
if (Diags.setDiagnosticGroupMapping(Opt, Mapping))
- Diags.Report(diag::warn_unknown_warning_option) << ("-W" + Opt.str());
+ Diags.Report(isPositive ? diag::warn_unknown_warning_option :
+ diag::warn_unknown_negative_warning_option)
+ << ("-W" + Opt.str());
}
}
More information about the cfe-commits
mailing list