@@ -54,21 +54,21 @@ 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 ? {
68
+ @_spi ( Testing) public func input ( neededFor source: DependencySource ) -> TypedVirtualPath ? {
69
69
guard let input =
70
70
info. simulateGetInputFailure ? nil
71
- : inputDependencySourceMap. getInputIfKnown ( for : source)
71
+ : inputDependencySourceMap. input ( ifKnownFor : source)
72
72
else {
73
73
info. diagnosticEngine. emit ( warning: " Failed to find source file for ' \( source. file. basename) ', recovering with a full rebuild. Next build will be incremental. " )
74
74
info. reporter? . report (
@@ -145,7 +145,7 @@ extension ModuleDependencyGraph {
145
145
return TransitivelyInvalidatedInputSet ( )
146
146
}
147
147
return collectInputsRequiringCompilationAfterProcessing (
148
- dependencySource: getRequiredSource ( for : input) )
148
+ dependencySource: source ( requiredFor : input) )
149
149
}
150
150
}
151
151
@@ -167,14 +167,14 @@ extension ModuleDependencyGraph {
167
167
/// speculatively scheduled in the first wave.
168
168
func collectInputsInvalidatedBy( input: TypedVirtualPath
169
169
) -> TransitivelyInvalidatedInputArray {
170
- let changedSource = getRequiredSource ( for : input)
170
+ let changedSource = source ( requiredFor : input)
171
171
let allDependencySourcesToRecompile =
172
172
collectSwiftDepsUsing ( dependencySource: changedSource)
173
173
174
174
return allDependencySourcesToRecompile. compactMap {
175
175
depedencySource in
176
176
guard depedencySource != changedSource else { return nil }
177
- let dependentInput = inputDependencySourceMap. getInputIfKnown ( for : depedencySource)
177
+ let dependentInput = inputDependencySourceMap. input ( ifKnownFor : depedencySource)
178
178
info. reporter? . report (
179
179
" Found dependent of \( input. file. basename) : " , dependentInput)
180
180
return dependentInput
@@ -194,7 +194,7 @@ extension ModuleDependencyGraph {
194
194
/// Does the graph contain any dependency nodes for a given source-code file?
195
195
func containsNodes( forSourceFile file: TypedVirtualPath ) -> Bool {
196
196
precondition ( file. type == . swift)
197
- guard let source = inputDependencySourceMap. getSourceIfKnown ( for: file) else {
197
+ guard let source = inputDependencySourceMap. sourceIfKnown ( for: file) else {
198
198
return false
199
199
}
200
200
return containsNodes ( forDependencySource: source)
@@ -207,7 +207,7 @@ extension ModuleDependencyGraph {
207
207
208
208
/// Returns: false on error
209
209
func populateInputDependencySourceMap(
210
- ` for` purpose: InputDependencySourceMap . AdditionPurpose
210
+ for purpose: InputDependencySourceMap . AdditionPurpose
211
211
) -> Bool {
212
212
let ofm = info. outputFileMap
213
213
let diags = info. diagnosticEngine
@@ -254,7 +254,7 @@ extension ModuleDependencyGraph {
254
254
func collectInputsRequiringCompilation( byCompiling input: TypedVirtualPath
255
255
) -> TransitivelyInvalidatedInputSet ? {
256
256
precondition ( input. type == . swift)
257
- let dependencySource = getRequiredSource ( for : input)
257
+ let dependencySource = source ( requiredFor : input)
258
258
return collectInputsRequiringCompilationAfterProcessing (
259
259
dependencySource: dependencySource)
260
260
}
@@ -341,7 +341,7 @@ extension ModuleDependencyGraph {
341
341
) -> TransitivelyInvalidatedInputSet ? {
342
342
var invalidatedInputs = TransitivelyInvalidatedInputSet ( )
343
343
for invalidatedSwiftDeps in collectSwiftDepsUsingInvalidated ( nodes: directlyInvalidatedNodes) {
344
- guard let invalidatedInput = getNeededInput ( for : invalidatedSwiftDeps)
344
+ guard let invalidatedInput = input ( neededFor : invalidatedSwiftDeps)
345
345
else {
346
346
return nil
347
347
}
0 commit comments