@@ -39,11 +39,8 @@ extension Driver {
39
39
func addJob( _ j: Job ) {
40
40
jobs. append ( j)
41
41
}
42
- func addJobs( _ js: [ Job ] ) {
43
- jobs. append ( contentsOf: js)
44
- }
45
42
46
- try addPrecompileModuleDependenciesJobs ( addJobs : addJobs )
43
+ try addPrecompileModuleDependenciesJobs ( addJob : addJob )
47
44
try addPrecompileBridgingHeaderJob ( addJob: addJob)
48
45
try addEmitModuleJob ( addJob: addJob)
49
46
@@ -55,7 +52,7 @@ extension Driver {
55
52
}
56
53
57
54
58
- private mutating func addPrecompileModuleDependenciesJobs( addJobs : ( [ Job ] ) -> Void ) throws {
55
+ private mutating func addPrecompileModuleDependenciesJobs( addJob : ( Job ) -> Void ) throws {
59
56
// If asked, add jobs to precompile module dependencies
60
57
guard parsedOptions. contains ( . driverExplicitModuleBuild) ||
61
58
parsedOptions. contains ( . driverPrintModuleDependenciesJobs)
@@ -64,7 +61,7 @@ extension Driver {
64
61
}
65
62
let modulePrebuildJobs = try generateExplicitModuleBuildJobs ( )
66
63
if parsedOptions. contains ( . driverExplicitModuleBuild) {
67
- addJobs ( modulePrebuildJobs)
64
+ modulePrebuildJobs. forEach ( addJob )
68
65
}
69
66
70
67
// If we've been asked to prebuild module dependencies,
@@ -104,7 +101,6 @@ extension Driver {
104
101
105
102
var linkerInputs = [ TypedVirtualPath] ( )
106
103
func addLinkerInput( _ li: TypedVirtualPath ) { linkerInputs. append ( li) }
107
- func addLinkerInputs( _ lis: [ TypedVirtualPath ] ) { linkerInputs. append ( contentsOf: lis) }
108
104
109
105
var moduleInputs = [ TypedVirtualPath] ( )
110
106
func addModuleInput( _ mi: TypedVirtualPath ) { moduleInputs. append ( mi) }
@@ -119,7 +115,7 @@ extension Driver {
119
115
addLinkerInput ( jobOutput)
120
116
121
117
case . swiftModule:
122
- moduleInputsFromJobOutputs . append ( jobOutput)
118
+ addModuleInputFromJobOutputs ( jobOutput)
123
119
124
120
default :
125
121
break
@@ -137,7 +133,7 @@ extension Driver {
137
133
addJobOutputs: addJobOutputs)
138
134
139
135
try addAutolinkExtractJob ( linkerInputs: linkerInputs,
140
- addLinkerInputs : addLinkerInputs ,
136
+ addLinkerInput : addLinkerInput ,
141
137
addJob: addJob)
142
138
143
139
if let mergeJob = try mergeModuleJob (
@@ -149,7 +145,7 @@ extension Driver {
149
145
mergeJob: mergeJob,
150
146
debugInfo: debugInfo,
151
147
addJob: addJob,
152
- addLinkerInputs : addLinkerInputs )
148
+ addLinkerInput : addLinkerInput )
153
149
}
154
150
return linkerInputs
155
151
}
@@ -317,21 +313,21 @@ extension Driver {
317
313
318
314
private mutating func addAutolinkExtractJob(
319
315
linkerInputs: [ TypedVirtualPath ] ,
320
- addLinkerInputs : ( [ TypedVirtualPath ] ) -> Void ,
316
+ addLinkerInput : ( TypedVirtualPath ) -> Void ,
321
317
addJob: ( Job ) -> Void )
322
318
throws
323
319
{
324
320
let autolinkInputs = linkerInputs. filter { $0. type == . object }
325
321
if let autolinkExtractJob = try autolinkExtractJob ( inputs: autolinkInputs) {
326
322
addJob ( autolinkExtractJob)
327
- addLinkerInputs ( autolinkExtractJob. outputs)
323
+ autolinkExtractJob. outputs. forEach ( addLinkerInput )
328
324
}
329
325
}
330
326
331
327
private mutating func addWrapJobOrMergeOutputs( mergeJob: Job ,
332
328
debugInfo: DebugInfo ,
333
329
addJob: ( Job ) -> Void ,
334
- addLinkerInputs : ( [ TypedVirtualPath ] ) -> Void )
330
+ addLinkerInput : ( TypedVirtualPath ) -> Void )
335
331
throws {
336
332
guard case . astTypes = debugInfo. level
337
333
else { return }
@@ -342,9 +338,9 @@ extension Driver {
342
338
" Merge module job should only have one swiftmodule output " )
343
339
let wrapJob = try moduleWrapJob ( moduleInput: mergeModuleOutputs [ 0 ] )
344
340
addJob ( wrapJob)
345
- addLinkerInputs ( wrapJob. outputs)
341
+ wrapJob. outputs. forEach ( addLinkerInput )
346
342
} else {
347
- addLinkerInputs ( mergeJob. outputs)
343
+ mergeJob. outputs. forEach ( addLinkerInput )
348
344
}
349
345
}
350
346
0 commit comments