@@ -54,19 +54,19 @@ import SwiftOptions
54
54
self . creationPhase = phase
55
55
}
56
56
57
- @_spi ( Testing) public func getRequiredSource ( for input: TypedVirtualPath ,
58
- function: String = #function,
59
- file: String = #file,
60
- line: Int = #line) -> DependencySource {
61
- guard let source = inputDependencySourceMap. getSourceIfKnown ( for: input)
57
+ @_spi ( Testing) public func source ( requiredFor input: TypedVirtualPath ,
58
+ function: String = #function,
59
+ file: String = #file,
60
+ line: Int = #line) -> DependencySource {
61
+ guard let source = inputDependencySourceMap. sourceIfKnown ( for: input)
62
62
else {
63
63
fatalError ( " \( input. file. basename) not found in inputDependencySourceMap, \( file) : \( line) in \( function) " )
64
64
}
65
65
return source
66
66
}
67
67
68
- @_spi ( Testing) public func getNeededInput ( for source: DependencySource ) -> TypedVirtualPath ? {
69
- guard let input = inputDependencySourceMap. getInputIfKnown ( for : source)
68
+ @_spi ( Testing) public func input ( neededFor source: DependencySource ) -> TypedVirtualPath ? {
69
+ guard let input = inputDependencySourceMap. input ( ifKnownFor : source)
70
70
else {
71
71
info. diagnosticEngine. emit ( warning: " Failed to find source file for ' \( source. file. basename) ', recovering with a full rebuild. Next build will be incremental. " )
72
72
return nil
@@ -141,7 +141,7 @@ extension ModuleDependencyGraph {
141
141
return TransitivelyInvalidatedInputSet ( )
142
142
}
143
143
return collectInputsRequiringCompilationAfterProcessing (
144
- dependencySource: getRequiredSource ( for : input) )
144
+ dependencySource: source ( requiredFor : input) )
145
145
}
146
146
}
147
147
@@ -163,14 +163,14 @@ extension ModuleDependencyGraph {
163
163
/// speculatively scheduled in the first wave.
164
164
func collectInputsInvalidatedBy( input: TypedVirtualPath
165
165
) -> TransitivelyInvalidatedInputArray {
166
- let changedSource = getRequiredSource ( for : input)
166
+ let changedSource = source ( requiredFor : input)
167
167
let allDependencySourcesToRecompile =
168
168
collectSwiftDepsUsing ( dependencySource: changedSource)
169
169
170
170
return allDependencySourcesToRecompile. compactMap {
171
171
depedencySource in
172
172
guard depedencySource != changedSource else { return nil }
173
- let dependentInput = inputDependencySourceMap. getInputIfKnown ( for : depedencySource)
173
+ let dependentInput = inputDependencySourceMap. input ( ifKnownFor : depedencySource)
174
174
info. reporter? . report (
175
175
" Found dependent of \( input. file. basename) : " , dependentInput)
176
176
return dependentInput
@@ -190,7 +190,7 @@ extension ModuleDependencyGraph {
190
190
/// Does the graph contain any dependency nodes for a given source-code file?
191
191
func containsNodes( forSourceFile file: TypedVirtualPath ) -> Bool {
192
192
precondition ( file. type == . swift)
193
- guard let source = inputDependencySourceMap. getSourceIfKnown ( for: file) else {
193
+ guard let source = inputDependencySourceMap. sourceIfKnown ( for: file) else {
194
194
return false
195
195
}
196
196
return containsNodes ( forDependencySource: source)
@@ -203,7 +203,7 @@ extension ModuleDependencyGraph {
203
203
204
204
/// Returns: false on error
205
205
func populateInputDependencySourceMap(
206
- ` for` purpose: InputDependencySourceMap . AdditionPurpose
206
+ for purpose: InputDependencySourceMap . AdditionPurpose
207
207
) -> Bool {
208
208
let ofm = info. outputFileMap
209
209
let diags = info. diagnosticEngine
@@ -250,7 +250,7 @@ extension ModuleDependencyGraph {
250
250
func collectInputsRequiringCompilation( byCompiling input: TypedVirtualPath
251
251
) -> TransitivelyInvalidatedInputSet ? {
252
252
precondition ( input. type == . swift)
253
- let dependencySource = getRequiredSource ( for : input)
253
+ let dependencySource = source ( requiredFor : input)
254
254
return collectInputsRequiringCompilationAfterProcessing (
255
255
dependencySource: dependencySource)
256
256
}
@@ -345,7 +345,7 @@ extension ModuleDependencyGraph {
345
345
) -> TransitivelyInvalidatedInputSet ? {
346
346
var invalidatedInputs = TransitivelyInvalidatedInputSet ( )
347
347
for invalidatedSwiftDeps in collectSwiftDepsUsingInvalidated ( nodes: directlyInvalidatedNodes) {
348
- guard let invalidatedInput = getNeededInput ( for : invalidatedSwiftDeps)
348
+ guard let invalidatedInput = input ( neededFor : invalidatedSwiftDeps)
349
349
else {
350
350
return nil
351
351
}
0 commit comments