[Frontend] Allow additional files for diagnostic verifier

This change adds a frontend flag, -verify-additional-file, which can be used to pass extra files directly to the diagnostic verifier. These files are not otherwise considered to be Swift source files; they are not compiled or even properly parsed.

This feature can be used to verify diagnostics emitted in non-source files, such as in module interfaces or header files.
This commit is contained in:
Brent Royal-Gordon
2020-09-18 17:52:38 -07:00
committed by Alexis Laferrière
parent ba00258c66
commit 5036a55550
7 changed files with 50 additions and 12 deletions

View File

@@ -957,6 +957,9 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
Opts.ShowDiagnosticsAfterFatalError |=
Args.hasArg(OPT_show_diagnostics_after_fatal);
for (Arg *A : Args.filtered(OPT_verify_additional_file))
Opts.AdditionalVerifierFiles.push_back(A->getValue());
Opts.UseColor |=
Args.hasFlag(OPT_color_diagnostics,
OPT_no_color_diagnostics,