@@ -1908,16 +1908,11 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
19081908 // explicit Swift module build tasks will not rely on them and they may be
19091909 // source-target-context-specific and hinder module sharing across
19101910 // compilation source targets.
1911- // If using DirectCC1Scan, the command-line reduction is handled inside
1912- // `getSwiftExplicitModuleDirectCC1Args()`, there is no need to inherit
1913- // anything here as the ExtraArgs from the invocation are clang driver
1914- // options, not cc1 options.
19151911 // Clang module dependecies of this Swift dependency will be distinguished
19161912 // by their context hash for different variants, so would still cause a
19171913 // difference in the Swift compile commands, when different.
1918- if (!clangImporterOpts.ClangImporterDirectCC1Scan )
1919- inheritedParentContextClangArgs =
1920- clangImporterOpts.getReducedExtraArgsForSwiftModuleDependency ();
1914+ inheritedParentContextClangArgs =
1915+ clangImporterOpts.getReducedExtraArgsForSwiftModuleDependency ();
19211916 genericSubInvocation.getFrontendOptions ()
19221917 .DependencyScanningSubInvocation = true ;
19231918 } else if (LoaderOpts.strictImplicitModuleContext ||
@@ -1931,9 +1926,15 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
19311926 inheritedParentContextClangArgs = clangImporterOpts.ExtraArgs ;
19321927 }
19331928 subClangImporterOpts.ExtraArgs = inheritedParentContextClangArgs;
1934- for (auto arg : subClangImporterOpts.ExtraArgs ) {
1935- GenericArgs.push_back (" -Xcc" );
1936- GenericArgs.push_back (ArgSaver.save (arg));
1929+ // If using DirectCC1Scan, the command-line reduction is handled inside
1930+ // `getSwiftExplicitModuleDirectCC1Args()`, there is no need to inherit
1931+ // anything here as the ExtraArgs from the invocation are clang driver
1932+ // options, not cc1 options.
1933+ if (!clangImporterOpts.ClangImporterDirectCC1Scan ) {
1934+ for (auto arg : subClangImporterOpts.ExtraArgs ) {
1935+ GenericArgs.push_back (" -Xcc" );
1936+ GenericArgs.push_back (ArgSaver.save (arg));
1937+ }
19371938 }
19381939
19391940 subClangImporterOpts.EnableClangSPI = clangImporterOpts.EnableClangSPI ;
0 commit comments