Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Sources/SwiftDriver/Jobs/PrebuiltModulesJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -812,13 +812,13 @@ extension Driver {
return (key, outputPaths)
})

func collectSwiftModuleNames(_ ids: [ModuleDependencyId]) -> [String] {
return ids.compactMap { id in
func collectUniqueSwiftModuleNames(_ ids: [ModuleDependencyId]) -> [String] {
return Array(Set(ids.compactMap { id in
if case .swift(let module) = id {
return module
}
return nil
}
}))
}

func getSwiftDependencies(for module: String) -> [String] {
Expand All @@ -827,7 +827,7 @@ extension Driver {
guard !dependencies.isEmpty else {
return []
}
return collectSwiftModuleNames(dependencies)
return collectUniqueSwiftModuleNames(dependencies)
}

func getOutputPaths(withName modules: [String], loadableFor arch: Triple.Arch) throws -> [TypedVirtualPath] {
Expand Down Expand Up @@ -870,7 +870,7 @@ extension Driver {
// Keep track of modules we haven't handled.
var unhandledModules = Set<String>(inputMap.keys)
// Start from those modules explicitly imported into the file under scanning
var openModules = collectSwiftModuleNames(dependencyGraph.mainModule.allDependencies)
var openModules = collectUniqueSwiftModuleNames(dependencyGraph.mainModule.allDependencies)
var idx = 0
while idx != openModules.count {
let module = openModules[idx]
Expand Down