mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -1169,9 +1169,14 @@ bool CompilerInstance::canImportCxxShim() const {
|
||||
ImportPath::Module::Builder builder(
|
||||
getASTContext().getIdentifier(CXX_SHIM_NAME));
|
||||
auto modulePath = builder.get();
|
||||
// Currently, Swift interfaces are not to expose their
|
||||
// C++ dependencies. Which means that when scanning them we should not
|
||||
// bring in such dependencies, including CxxShims.
|
||||
return getASTContext().testImportModule(modulePath) &&
|
||||
!Invocation.getFrontendOptions()
|
||||
.InputsAndOutputs.hasModuleInterfaceOutputPath();
|
||||
.InputsAndOutputs.hasModuleInterfaceOutputPath() &&
|
||||
!Invocation.getFrontendOptions()
|
||||
.DependencyScanningSubInvocation;
|
||||
}
|
||||
|
||||
bool CompilerInstance::supportCaching() const {
|
||||
|
||||
Reference in New Issue
Block a user