@@ -54,10 +54,10 @@ extension IncrementalCompilationState {
54
54
55
55
public func compute( batchJobFormer: inout Driver ) throws -> FirstWave {
56
56
return try blockingConcurrentAccessOrMutation {
57
- let ( initiallySkippedCompileGroups , mandatoryJobsInOrder) =
57
+ let ( initiallySkippedCompileJobs , mandatoryJobsInOrder) =
58
58
try computeInputsAndGroups ( batchJobFormer: & batchJobFormer)
59
59
return FirstWave (
60
- initiallySkippedCompileGroups : initiallySkippedCompileGroups ,
60
+ initiallySkippedCompileJobs : initiallySkippedCompileJobs ,
61
61
mandatoryJobsInOrder: mandatoryJobsInOrder)
62
62
}
63
63
}
@@ -76,33 +76,33 @@ extension IncrementalCompilationState.FirstWaveComputer {
76
76
/// At this stage the graph will have all external dependencies found in the swiftDeps or in the priors
77
77
/// listed in fingerprintExternalDependencies.
78
78
private func computeInputsAndGroups( batchJobFormer: inout Driver )
79
- throws -> ( initiallySkippedCompileGroups : [ TypedVirtualPath : CompileJobGroup ] ,
79
+ throws -> ( initiallySkippedCompileJobs : [ TypedVirtualPath : Job ] ,
80
80
mandatoryJobsInOrder: [ Job ] )
81
81
{
82
- let compileGroups =
82
+ let compileJobs =
83
83
Dictionary ( uniqueKeysWithValues:
84
- jobsInPhases. compileGroups . map { ( $0. primaryInput , $0) } )
84
+ jobsInPhases. compileJobs . map { ( $0. primaryInputs [ 0 ] , $0) } )
85
85
let buildRecord = self . moduleDependencyGraph. buildRecord
86
86
let jobCreatingPch = jobsInPhases. beforeCompiles. first ( where: { $0. kind == . generatePCH} )
87
87
guard !buildRecord. inputInfos. isEmpty else {
88
88
func everythingIsMandatory( )
89
- throws -> ( initiallySkippedCompileGroups : [ TypedVirtualPath : CompileJobGroup ] ,
89
+ throws -> ( initiallySkippedCompileJobs : [ TypedVirtualPath : Job ] ,
90
90
mandatoryJobsInOrder: [ Job ] )
91
91
{
92
- let mandatoryCompileGroupsInOrder = self . inputFiles. swiftSourceFiles. compactMap {
93
- input -> CompileJobGroup ? in
94
- compileGroups [ input. typedFile]
92
+ let mandatoryCompileJobsInOrder = self . inputFiles. swiftSourceFiles. compactMap {
93
+ input -> Job ? in
94
+ compileJobs [ input. typedFile]
95
95
}
96
96
97
97
let mandatoryJobsInOrder = try
98
98
jobsInPhases. beforeCompiles +
99
99
batchJobFormer. formBatchedJobs (
100
- mandatoryCompileGroupsInOrder . flatMap { $0 . allJobs ( ) } ,
100
+ mandatoryCompileJobsInOrder ,
101
101
showJobLifecycle: showJobLifecycle,
102
102
jobCreatingPch: jobCreatingPch)
103
103
104
104
moduleDependencyGraph. setPhase ( to: . buildingAfterEachCompilation)
105
- return ( initiallySkippedCompileGroups : [ : ] ,
105
+ return ( initiallySkippedCompileJobs : [ : ] ,
106
106
mandatoryJobsInOrder: mandatoryJobsInOrder)
107
107
}
108
108
return try everythingIsMandatory ( )
@@ -114,17 +114,17 @@ extension IncrementalCompilationState.FirstWaveComputer {
114
114
moduleDependencyGraph,
115
115
buildRecord)
116
116
117
- let initiallySkippedCompileGroups = compileGroups . filter { initiallySkippedInputs. contains ( $0. key) }
117
+ let initiallySkippedCompileJobs = compileJobs . filter { initiallySkippedInputs. contains ( $0. key) }
118
118
119
- let mandatoryCompileGroupsInOrder = inputFiles. compactMap {
120
- input -> CompileJobGroup ? in
119
+ let mandatoryCompileJobsInOrder = inputFiles. compactMap {
120
+ input -> Job ? in
121
121
initiallySkippedInputs. contains ( input)
122
122
? nil
123
- : compileGroups [ input]
123
+ : compileJobs [ input]
124
124
}
125
125
126
126
let batchedCompilationJobs = try batchJobFormer. formBatchedJobs (
127
- mandatoryCompileGroupsInOrder . flatMap { $0 . allJobs ( ) } ,
127
+ mandatoryCompileJobsInOrder ,
128
128
showJobLifecycle: showJobLifecycle,
129
129
jobCreatingPch: jobCreatingPch)
130
130
@@ -133,7 +133,7 @@ extension IncrementalCompilationState.FirstWaveComputer {
133
133
// have any dependencies on them.
134
134
let skipAllJobs = batchedCompilationJobs. isEmpty ? !nonVerifyAfterCompileJobsDependOnBeforeCompileJobs( ) : false
135
135
let mandatoryJobsInOrder = skipAllJobs ? [ ] : jobsInPhases. beforeCompiles + batchedCompilationJobs
136
- return ( initiallySkippedCompileGroups : initiallySkippedCompileGroups ,
136
+ return ( initiallySkippedCompileJobs : initiallySkippedCompileJobs ,
137
137
mandatoryJobsInOrder: mandatoryJobsInOrder)
138
138
}
139
139
@@ -156,7 +156,7 @@ extension IncrementalCompilationState.FirstWaveComputer {
156
156
_ moduleDependencyGraph: ModuleDependencyGraph ,
157
157
_ buildRecord: BuildRecord
158
158
) -> Set < TypedVirtualPath > {
159
- let allGroups = jobsInPhases. compileGroups
159
+ let allCompileJobs = jobsInPhases. compileJobs
160
160
// Input == source file
161
161
let changedInputs = computeChangedInputs ( moduleDependencyGraph, buildRecord)
162
162
@@ -176,9 +176,9 @@ extension IncrementalCompilationState.FirstWaveComputer {
176
176
reporter. report ( " Has malformed dependency source; will queue " , input)
177
177
}
178
178
}
179
- let inputsMissingOutputs = allGroups . compactMap {
179
+ let inputsMissingOutputs = allCompileJobs . compactMap {
180
180
$0. outputs. contains { ( try ? !fileSystem. exists ( $0. file) ) ?? true }
181
- ? $0. primaryInput
181
+ ? $0. primaryInputs [ 0 ]
182
182
: nil
183
183
}
184
184
if let reporter = reporter {
@@ -257,8 +257,8 @@ extension IncrementalCompilationState.FirstWaveComputer {
257
257
_ moduleDependencyGraph: ModuleDependencyGraph ,
258
258
_ outOfDateBuildRecord: BuildRecord
259
259
) -> [ ChangedInput ] {
260
- jobsInPhases. compileGroups . compactMap { group in
261
- let input = group . primaryInput
260
+ jobsInPhases. compileJobs . compactMap { job in
261
+ let input = job . primaryInputs [ 0 ]
262
262
let modDate = buildRecordInfo. compilationInputModificationDates [ input] ?? . distantFuture
263
263
let inputInfo = outOfDateBuildRecord. inputInfos [ input. file]
264
264
let previousCompilationStatus = inputInfo? . status ?? . newlyAdded
0 commit comments