[NFC] Pipe PrintDiagnosticNames through swiftinterface loader

This commit is contained in:
Becca Royal-Gordon
2025-08-20 14:51:57 -07:00
parent 1b38c919c7
commit 89ecc5ab2a
2 changed files with 20 additions and 3 deletions

View File

@@ -1663,7 +1663,8 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
FrontendOptions::ActionType requestedAction,
const SearchPathOptions &SearchPathOpts, const LangOptions &LangOpts,
const ClangImporterOptions &clangImporterOpts, const CASOptions &casOpts,
bool suppressNotes, bool suppressRemarks) {
bool suppressNotes, bool suppressRemarks,
PrintDiagnosticNamesMode printDiagnosticNames) {
GenericArgs.push_back("-frontend");
// Start with a genericSubInvocation that copies various state from our
// invoking ASTContext.
@@ -1764,6 +1765,20 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
GenericArgs.push_back("-suppress-remarks");
}
// Inherit the parent invocation's setting for printing diagnostic IDs.
genericSubInvocation.getDiagnosticOptions().PrintDiagnosticNames =
printDiagnosticNames;
switch (printDiagnosticNames) {
case PrintDiagnosticNamesMode::None:
break;
case PrintDiagnosticNamesMode::Identifier:
GenericArgs.push_back("-debug-diagnostic-names");
break;
case PrintDiagnosticNamesMode::Group:
// FIXME: Currently no flag for Group mode
break;
}
// Inherit this setting down so that it can affect error diagnostics (mostly
// by making them non-fatal).
genericSubInvocation.getLangOptions().DebuggerSupport = LangOpts.DebuggerSupport;
@@ -1870,7 +1885,8 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
inheritOptionsForBuildingInterface(LoaderOpts.requestedAction, searchPathOpts,
langOpts, clangImporterOpts, casOpts,
Diags->getSuppressNotes(),
Diags->getSuppressRemarks());
Diags->getSuppressRemarks(),
Diags->getPrintDiagnosticNamesMode());
// Configure front-end input.
auto &SubFEOpts = genericSubInvocation.getFrontendOptions();
SubFEOpts.RequestedAction = LoaderOpts.requestedAction;