Skip to content

Commit 8fbcdf3

Browse files
committed
[NFC] Use IncrementalJobAction to Supersede getFirstSwiftPrimaryInput()
This function was being used in a roundabout way to test for a compile job action. But the actual data itself was not being used.
1 parent e5737bc commit 8fbcdf3

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lib/Driver/Compilation.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)