[Dependency Scanning] Interface-scanning sub-invocations should not attempt to import CxxShims

Swift interfaces currently aren't meant to expose C++ in their API so we should not also bring in this C++-related module dependency which is not found when the ClangImporter is not configured for C++.
This commit is contained in:
Artem Chikin
2024-02-14 12:45:46 -08:00
parent 9607e9dec1
commit bb5e20d015
4 changed files with 29 additions and 1 deletions

View File

@@ -1803,6 +1803,8 @@ InterfaceSubContextDelegateImpl::InterfaceSubContextDelegateImpl(
// in the Swift compile commands, when different.
inheritedParentContextClangArgs =
clangImporterOpts.getReducedExtraArgsForSwiftModuleDependency();
genericSubInvocation.getFrontendOptions()
.DependencyScanningSubInvocation = true;
} else if (LoaderOpts.strictImplicitModuleContext) {
// If the compiler has been asked to be strict with ensuring downstream
// dependencies get the parent invocation's context, inherit the extra Clang