aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/Warnings.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-01-15 01:21:53 +0000
committerChad Rosier <mcrosier@apple.com>2013-01-15 01:21:53 +0000
commit08e79d2f075d1326ff7a849fd1bc88dadf99d574 (patch)
treeaab08f26b33435b76e46e172168fb26e21a97b51 /lib/Frontend/Warnings.cpp
parent714911f092edeb8b329932f457ef0875725d1c07 (diff)
[driver] Warnings for warning options are handled by the frontend. The driver needs to process the
warning options to setup diagnostic state, but should not be emitting warnings as these would be rudndant with what the frontend emits. rdar://13001556 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172497 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/Warnings.cpp')
-rw-r--r--lib/Frontend/Warnings.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Frontend/Warnings.cpp b/lib/Frontend/Warnings.cpp
index b4c6b0bd73..767096a1c9 100644
--- a/lib/Frontend/Warnings.cpp
+++ b/lib/Frontend/Warnings.cpp
@@ -48,7 +48,8 @@ static void EmitUnknownDiagWarning(DiagnosticsEngine &Diags,
}
void clang::ProcessWarningOptions(DiagnosticsEngine &Diags,
- const DiagnosticOptions &Opts) {
+ const DiagnosticOptions &Opts,
+ bool ReportDiags) {
Diags.setSuppressSystemWarnings(true); // Default to -Wno-system-headers
Diags.setIgnoreAllWarnings(Opts.IgnoreWarnings);
Diags.setShowOverloads(Opts.getShowOverloads());
@@ -84,6 +85,12 @@ void clang::ProcessWarningOptions(DiagnosticsEngine &Diags,
// conflicting options.
for (unsigned Report = 0, ReportEnd = 2; Report != ReportEnd; ++Report) {
bool SetDiagnostic = (Report == 0);
+
+ // If we've set the diagnostic state and are not reporting diagnostics then
+ // we're done.
+ if (!SetDiagnostic && !ReportDiags)
+ break;
+
for (unsigned i = 0, e = Opts.Warnings.size(); i != e; ++i) {
StringRef Opt = Opts.Warnings[i];
StringRef OrigOpt = Opts.Warnings[i];