[Diagnostics] -suppress-warnings and -warnings-as-errors flags

Exposes the global warning suppression and treatment as errors
functionality to the Swift driver. Introduces the flags
"-suppress-warnings" and "-warnings-as-errors". Test case include.
This commit is contained in:
Michael Ilseman
2016-01-13 18:38:26 -08:00
parent 8b5fb7d200
commit dc689e607c
10 changed files with 70 additions and 7 deletions

View File

@@ -147,6 +147,13 @@ static void validateArgs(DiagnosticEngine &diags, const ArgList &Args) {
}
}
}
// Check for conflicting warning control flags
if (Args.hasArg(options::OPT_suppress_warnings) &&
Args.hasArg(options::OPT_warnings_as_errors)) {
diags.diagnose(SourceLoc(), diag::error_conflicting_options,
"-warnings-as-errors", "-suppress-warnings");
}
}
static void computeArgsHash(SmallString<32> &out, const DerivedArgList &args) {