Skip to content

Commit 2b22033

Browse files
author
David Ungar
committed
reorg phase
1 parent 005e764 commit 2b22033

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Sources/SwiftDriver/IncrementalCompilation/ModuleDependencyGraph.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ extension ModuleDependencyGraph {
8585
return true
8686
}
8787
}
88+
89+
var isCompilingAllInputsNoMatterWhat: Bool {
90+
switch self {
91+
case .buildingAfterEachCompilation:
92+
return true
93+
case .buildingWithoutAPrior, .updatingFromAPrior, .updatingAfterCompilation:
94+
return false
95+
}
96+
}
8897
}
8998
}
9099

@@ -298,14 +307,14 @@ extension ModuleDependencyGraph {
298307
? collectNodesInvalidatedByAttemptingToProcess(fed, info)
299308
: nil
300309

301-
if phase == .buildingAfterEachCompilation {
310+
if phase.isCompilingAllInputsNoMatterWhat {
302311
// going to compile every input anyway, less work for callers
303312
return DirectlyInvalidatedNodes()
304313
}
305314

306315
/// When building a graph from scratch, an unchanged but new-to-the-graph external dependendcy should be ignored.
307316
/// Otherwise, it represents an added Import
308-
let callerWantsTheseChanges = (phase != .buildingWithoutAPrior && isNewToTheGraph) ||
317+
let callerWantsTheseChanges = (phase.isUpdating && isNewToTheGraph) ||
309318
lazyModTimer.hasExternalFileChanged
310319

311320
guard callerWantsTheseChanges else {

0 commit comments

Comments
 (0)