@@ -366,26 +366,31 @@ extension IncrementalCompilationState {
366
366
/// Remember a job (group) that is before a compile or a compile itself.
367
367
/// (A group also includes the "backend" jobs for bitcode.)
368
368
/// Decide if a job can be skipped, and register accordingly
369
- func addPreOrCompileJobGroups( _ groups: [ [ Job ] ] ) {
369
+ func addPreOrCompileJobGroups( _ groups: [ [ Job ] ] ,
370
+ formBatchedJobs: ( [ Job ] ) throws -> [ Job ]
371
+ ) throws {
370
372
for group in groups {
371
373
if let firstJob = group. first, isSkipped ( firstJob) {
372
374
recordSkippedGroup ( group)
373
375
}
374
376
else {
375
- scheduleMandatoryPreOrCompile ( group: group)
377
+ try scheduleMandatoryPreOrCompile ( group: group, formBatchedJobs : formBatchedJobs )
376
378
}
377
379
}
378
380
}
379
381
380
382
/// Remember that `group` (a compilation and possibly bitcode generation)
381
383
/// must definitely be executed.
382
- private func scheduleMandatoryPreOrCompile( group: [ Job ] ) {
384
+ private func scheduleMandatoryPreOrCompile(
385
+ group: [ Job ] ,
386
+ formBatchedJobs: ( [ Job ] ) throws -> [ Job ]
387
+ ) throws {
383
388
if let report = reportIncrementalDecision {
384
389
for job in group {
385
390
report ( " Queuing \( job. descriptionForLifecycle) " , nil )
386
391
}
387
392
}
388
- mandatoryPreOrCompileJobsInOrder. append ( contentsOf: group)
393
+ mandatoryPreOrCompileJobsInOrder. append ( contentsOf: try formBatchedJobs ( group) )
389
394
unfinishedMandatoryJobs. formUnion ( group)
390
395
let mandantoryCompilationInputs = group
391
396
. flatMap { $0. kind == . compile ? $0. primaryInputs : [ ] }
0 commit comments