@@ -1908,16 +1908,11 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
1908
1908
// explicit Swift module build tasks will not rely on them and they may be
1909
1909
// source-target-context-specific and hinder module sharing across
1910
1910
// 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.
1915
1911
// Clang module dependecies of this Swift dependency will be distinguished
1916
1912
// by their context hash for different variants, so would still cause a
1917
1913
// difference in the Swift compile commands, when different.
1918
- if (!clangImporterOpts.ClangImporterDirectCC1Scan )
1919
- inheritedParentContextClangArgs =
1920
- clangImporterOpts.getReducedExtraArgsForSwiftModuleDependency ();
1914
+ inheritedParentContextClangArgs =
1915
+ clangImporterOpts.getReducedExtraArgsForSwiftModuleDependency ();
1921
1916
genericSubInvocation.getFrontendOptions ()
1922
1917
.DependencyScanningSubInvocation = true ;
1923
1918
} else if (LoaderOpts.strictImplicitModuleContext ||
@@ -1931,9 +1926,15 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
1931
1926
inheritedParentContextClangArgs = clangImporterOpts.ExtraArgs ;
1932
1927
}
1933
1928
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
+ }
1937
1938
}
1938
1939
1939
1940
subClangImporterOpts.EnableClangSPI = clangImporterOpts.EnableClangSPI ;
0 commit comments