@@ -1663,7 +1663,8 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
16631663 FrontendOptions::ActionType requestedAction,
16641664 const SearchPathOptions &SearchPathOpts, const LangOptions &LangOpts,
16651665 const ClangImporterOptions &clangImporterOpts, const CASOptions &casOpts,
1666- bool suppressNotes, bool suppressRemarks) {
1666+ bool suppressNotes, bool suppressRemarks,
1667+ PrintDiagnosticNamesMode printDiagnosticNames) {
16671668 GenericArgs.push_back (" -frontend" );
16681669 // Start with a genericSubInvocation that copies various state from our
16691670 // invoking ASTContext.
@@ -1764,6 +1765,20 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
17641765 GenericArgs.push_back (" -suppress-remarks" );
17651766 }
17661767
1768+ // Inherit the parent invocation's setting for printing diagnostic IDs.
1769+ genericSubInvocation.getDiagnosticOptions ().PrintDiagnosticNames =
1770+ printDiagnosticNames;
1771+ switch (printDiagnosticNames) {
1772+ case PrintDiagnosticNamesMode::None:
1773+ break ;
1774+ case PrintDiagnosticNamesMode::Identifier:
1775+ GenericArgs.push_back (" -debug-diagnostic-names" );
1776+ break ;
1777+ case PrintDiagnosticNamesMode::Group:
1778+ // FIXME: Currently no flag for Group mode
1779+ break ;
1780+ }
1781+
17671782 // Inherit this setting down so that it can affect error diagnostics (mostly
17681783 // by making them non-fatal).
17691784 genericSubInvocation.getLangOptions ().DebuggerSupport = LangOpts.DebuggerSupport ;
@@ -1870,7 +1885,8 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
18701885 inheritOptionsForBuildingInterface (LoaderOpts.requestedAction , searchPathOpts,
18711886 langOpts, clangImporterOpts, casOpts,
18721887 Diags->getSuppressNotes (),
1873- Diags->getSuppressRemarks ());
1888+ Diags->getSuppressRemarks (),
1889+ Diags->getPrintDiagnosticNamesMode ());
18741890 // Configure front-end input.
18751891 auto &SubFEOpts = genericSubInvocation.getFrontendOptions ();
18761892 SubFEOpts.RequestedAction = LoaderOpts.requestedAction ;
0 commit comments