@@ -209,7 +209,7 @@ namespace driver {
209
209
// / Jobs in the initial set with Condition::Always, and having an existing
210
210
// / .swiftdeps files.
211
211
// / Set by scheduleInitialJobs and used only by scheduleAdditionalJobs.
212
- SmallVector<const Job *, 16 > InitialOutOfDateCommands ;
212
+ SmallVector<const Job *, 16 > InitialCascadingCommands ;
213
213
214
214
// / Dependency graph for deciding which jobs are dirty (need running)
215
215
// / or clean (can be skipped).
@@ -407,6 +407,13 @@ namespace driver {
407
407
// If we have a dependency file /and/ the frontend task exited normally,
408
408
// we can be discerning about what downstream files to rebuild.
409
409
if (ReturnCode == EXIT_SUCCESS || ReturnCode == EXIT_FAILURE) {
410
+ // "Marked" means that everything provided by this node (i.e. Job) is
411
+ // dirty. Thus any file using any of these provides must be
412
+ // recompiled. (Only non-private entities are output as provides.) In
413
+ // other words, this Job "cascades"; the need to recompile it causes
414
+ // other recompilations. It is possible that the current code marks
415
+ // things that do not need to be marked. Unecessary compilation would
416
+ // result if that were the case.
410
417
bool wasCascading = DepGraph.isMarked (FinishedCmd);
411
418
412
419
switch (DepGraph.loadFromPath (FinishedCmd, DependenciesFile)) {
@@ -717,14 +724,14 @@ namespace driver {
717
724
case Job::Condition::Always:
718
725
if (Comp.getIncrementalBuildEnabled () && !DependenciesFile.empty ()) {
719
726
// Ensure dependents will get recompiled.
720
- InitialOutOfDateCommands .push_back (Cmd);
727
+ InitialCascadingCommands .push_back (Cmd);
721
728
// Mark this job as cascading.
722
729
//
723
730
// It would probably be safe and simpler to markTransitive on the
724
731
// start nodes in the "Always" condition from the start instead of
725
732
// using markIntransitive and having later functions call
726
- // markTransitive. That way markInstransitive would be an
727
- // implementation detail.
733
+ // markTransitive. That way markIntransitive would be an
734
+ // implementation detail of DependencyGraph .
728
735
DepGraph.markIntransitive (Cmd);
729
736
}
730
737
LLVM_FALLTHROUGH;
@@ -749,7 +756,7 @@ namespace driver {
749
756
// We scheduled all of the files that have actually changed. Now add the
750
757
// files that haven't changed, so that they'll get built in parallel if
751
758
// possible and after the first set of files if it's not.
752
- for (auto *Cmd : InitialOutOfDateCommands ) {
759
+ for (auto *Cmd : InitialCascadingCommands ) {
753
760
DepGraph.markTransitive (AdditionalOutOfDateCommands, Cmd,
754
761
IncrementalTracer);
755
762
}
0 commit comments