@@ -860,7 +860,7 @@ namespace driver {
860860 computeFirstRoundCompileJobsForIncrementalCompilation ();
861861
862862 for (const Job *Cmd : Comp.getJobs ()) {
863- if (Cmd->getFirstSwiftPrimaryInput (). empty ( ) ||
863+ if (!isa<IncrementalJobAction>( Cmd->getSource () ) ||
864864 compileJobsToSchedule.count (Cmd)) {
865865 scheduleCommandIfNecessaryAndPossible (Cmd);
866866 noteBuilding (Cmd, /* willBeBuilding*/ true , /* isTentative=*/ false ,
@@ -899,20 +899,22 @@ namespace driver {
899899 CommandSet
900900 computeDependenciesAndGetNeededCompileJobs (const bool forRanges) {
901901 auto getEveryCompileJob = [&] {
902- CommandSet everyCompileJob ;
902+ CommandSet everyIncrementalJob ;
903903 for (const Job *Cmd : Comp.getJobs ()) {
904- if (! Cmd->getFirstSwiftPrimaryInput (). empty ( ))
905- everyCompileJob .insert (Cmd);
904+ if (isa<IncrementalJobAction>( Cmd->getSource () ))
905+ everyIncrementalJob .insert (Cmd);
906906 }
907- return everyCompileJob ;
907+ return everyIncrementalJob ;
908908 };
909909
910910 CommandSet jobsToSchedule;
911911 CommandSet initialCascadingCommands;
912912 for (const Job *cmd : Comp.getJobs ()) {
913- const StringRef primary = cmd->getFirstSwiftPrimaryInput ();
914- if (primary.empty ())
915- continue ; // not Compile
913+ // Skip jobs that have no associated incremental info.
914+ if (!isa<IncrementalJobAction>(cmd->getSource ())) {
915+ continue ;
916+ }
917+
916918 const Optional<std::pair<bool , bool >> shouldSchedAndIsCascading =
917919 computeShouldInitiallyScheduleJobAndDependendents (cmd, forRanges);
918920 if (!shouldSchedAndIsCascading)
0 commit comments