[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

@@ -922,6 +922,11 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
Args.hasArg(OPT_show_diagnostics_after_fatal);
Opts.UseColor |= Args.hasArg(OPT_color_diagnostics);
Opts.FixitCodeForAllDiagnostics |= Args.hasArg(OPT_fixit_all);
Opts.SuppressWarnings |= Args.hasArg(OPT_suppress_warnings);
Opts.WarningsAsErrors |= Args.hasArg(OPT_warnings_as_errors);
assert(!(Opts.WarningsAsErrors && Opts.SuppressWarnings) &&
"conflicting arguments; should of been caught by driver");
return false;
}