Frontend: Parse diagnostic options earlier.

Diagnostics may be emitted while parsing command line arguments. This implies
that the options which affect how diagnostics are emitted and presented need to
be parsed first.
This commit is contained in:
Allan Shortlidge
2025-01-14 23:18:40 -08:00
parent 29bcd2caa0
commit 4ea157efdb
4 changed files with 78 additions and 45 deletions

View File

@@ -2248,10 +2248,6 @@ InterfaceSubContextDelegateImpl::runInSubCompilerInstance(StringRef moduleName,
subInstance.addDiagnosticConsumer(&noopConsumer);
}
// Eagerly suppress warnings if necessary, before parsing arguments.
if (subInvocation.getDiagnosticOptions().SuppressWarnings)
subInstance.getDiags().setSuppressWarnings(true);
SwiftInterfaceInfo interfaceInfo;
// Extract compiler arguments from the interface file and use them to configure
// the compiler invocation.