[Dependency Scanning] Do not process transitive '@_implementationOnly' dependencies of binary Swift modules

These modules are not guaranteed to be found, which is okay, as compilation is meant to be possible in their absense since their contents are not used in the public API of the module which imports them as implementation-only.

Resolves rdar://103031296
This commit is contained in:
Artem Chikin
2023-01-30 14:25:23 -08:00
parent c707643396
commit 957f49add9
2 changed files with 24 additions and 0 deletions

View File

@@ -420,6 +420,12 @@ llvm::ErrorOr<ModuleDependencyInfo> SerializedModuleLoaderBase::scanModuleFile(
if (dependency.isHeader())
continue;
// Transitive @_implementationOnly dependencies of
// binary modules are not required to be imported during normal builds
// TODO: This is worth revisiting for debugger purposes
if (dependency.isImplementationOnly())
continue;
// Find the top-level module name.
auto modulePathStr = dependency.getPrettyPrintedPath();
StringRef moduleName = modulePathStr;