mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Use the new logic for transitive dependencies in the scanner
This commit is contained in:
@@ -420,14 +420,18 @@ 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;
|
||||
|
||||
if (dependency.isPackageOnly() &&
|
||||
Ctx.LangOpts.PackageName != loadedModuleFile->getModulePackageName())
|
||||
// Some transitive dependencies of binary modules are not required to be
|
||||
// imported during normal builds.
|
||||
// TODO: This is worth revisiting for debugger purposes where
|
||||
// loading the module is optional, and implementation-only imports
|
||||
// from modules with testing enabled where the dependency is
|
||||
// optional.
|
||||
ModuleLoadingBehavior transitiveBehavior =
|
||||
loadedModuleFile->getTransitiveLoadingBehavior(dependency,
|
||||
/*debuggerMode*/false,
|
||||
/*isPartialModule*/false,
|
||||
/*package*/Ctx.LangOpts.PackageName);
|
||||
if (transitiveBehavior != ModuleLoadingBehavior::Required)
|
||||
continue;
|
||||
|
||||
// Find the top-level module name.
|
||||
|
||||
Reference in New Issue
Block a user