mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Ignore missing potentially optional dependencies in getImportedModules
The service `ModuleFile::getImportedModules` is called after the dependency loading logic runs. We can trust this previous logic to have correctly loaded optional dependencies. In `getImportedModules` we can just ignore such missing dependencies. rdar://115372249
This commit is contained in:
@@ -496,20 +496,20 @@ void ModuleFile::getImportedModules(SmallVectorImpl<ImportedModule> &results,
|
||||
continue;
|
||||
|
||||
} else if (dep.isImplementationOnly()) {
|
||||
if (!filter.contains(ModuleDecl::ImportFilterKind::ImplementationOnly))
|
||||
// Pretend we didn't have potentially optional imports if we weren't
|
||||
// originally asked to load it.
|
||||
if (!filter.contains(ModuleDecl::ImportFilterKind::ImplementationOnly) ||
|
||||
!dep.isLoaded())
|
||||
continue;
|
||||
if (!dep.isLoaded()) {
|
||||
// Pretend we didn't have this import if we weren't originally asked to
|
||||
// load it.
|
||||
continue;
|
||||
}
|
||||
|
||||
} else if (dep.isInternalOrBelow()) {
|
||||
if (!filter.contains(ModuleDecl::ImportFilterKind::InternalOrBelow))
|
||||
if (!filter.contains(ModuleDecl::ImportFilterKind::InternalOrBelow) ||
|
||||
!dep.isLoaded())
|
||||
continue;
|
||||
|
||||
} else if (dep.isPackageOnly()) {
|
||||
if (!filter.contains(ModuleDecl::ImportFilterKind::PackageOnly))
|
||||
if (!filter.contains(ModuleDecl::ImportFilterKind::PackageOnly) ||
|
||||
!dep.isLoaded())
|
||||
continue;
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user