Skip to content

Commit da13d89

Browse files
committed
Move DummyQueue logic into buildTaskQueue
1 parent d7493dd commit da13d89

File tree

3 files changed

+5
-20
lines changed

3 files changed

+5
-20
lines changed

include/swift/Driver/Compilation.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,6 @@ class Compilation {
149149
/// If unknown, this will be some time in the past.
150150
llvm::sys::TimePoint<> LastBuildTime = llvm::sys::TimePoint<>::min();
151151

152-
/// Indicates whether this Compilation should use skip execution of
153-
/// subtasks during performJobs() by using a dummy TaskQueue.
154-
///
155-
/// \note For testing purposes only; similar user-facing features should be
156-
/// implemented separately, as the dummy TaskQueue may provide faked output.
157-
const bool SkipTaskExecution;
158-
159152
/// Indicates whether this Compilation should continue execution of subtasks
160153
/// even if they returned an error status.
161154
bool ContinueBuildingAfterErrors = false;
@@ -236,7 +229,6 @@ class Compilation {
236229
bool EnableBatchMode = false,
237230
unsigned BatchSeed = 0,
238231
bool ForceOneBatchRepartition = false,
239-
bool SkipTaskExecution = false,
240232
bool SaveTemps = false,
241233
bool ShowDriverTimeCompilation = false,
242234
std::unique_ptr<UnifiedStatsReporter> Stats = nullptr);
@@ -296,10 +288,6 @@ class Compilation {
296288

297289
bool getForceOneBatchRepartition() const { return ForceOneBatchRepartition; }
298290

299-
bool wantsDummyQueue() const {
300-
return SkipTaskExecution;
301-
}
302-
303291
bool getContinueBuildingAfterErrors() const {
304292
return ContinueBuildingAfterErrors;
305293
}

lib/Driver/Compilation.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ Compilation::Compilation(DiagnosticEngine &Diags,
112112
bool EnableBatchMode,
113113
unsigned BatchSeed,
114114
bool ForceOneBatchRepartition,
115-
bool SkipTaskExecution,
116115
bool SaveTemps,
117116
bool ShowDriverTimeCompilation,
118117
std::unique_ptr<UnifiedStatsReporter> StatsReporter)
@@ -126,7 +125,6 @@ Compilation::Compilation(DiagnosticEngine &Diags,
126125
ArgsHash(ArgsHash),
127126
BuildStartTime(StartTime),
128127
LastBuildTime(LastBuildTime),
129-
SkipTaskExecution(SkipTaskExecution),
130128
EnableIncrementalBuild(EnableIncrementalBuild),
131129
OutputCompilationRecordForModuleOnlyBuild(
132130
OutputCompilationRecordForModuleOnlyBuild),
@@ -1223,7 +1221,7 @@ int Compilation::performJobsImpl(bool &abnormalExit,
12231221
State.runTaskQueueToCompletion();
12241222
State.checkUnfinishedJobs();
12251223

1226-
if (!CompilationRecordPath.empty() && !SkipTaskExecution) {
1224+
if (!CompilationRecordPath.empty()) {
12271225
InputInfoMap InputInfo;
12281226
State.populateInputInfoMap(InputInfo);
12291227
checkForOutOfDateInputs(Diags, InputInfo);

lib/Driver/Driver.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,10 @@ std::unique_ptr<sys::TaskQueue> Driver::buildTaskQueue(const Compilation &C) {
296296
}
297297
}
298298

299-
if (C.wantsDummyQueue()) {
299+
const bool DriverSkipExecution =
300+
ArgList.hasArg(options::OPT_driver_skip_execution,
301+
options::OPT_driver_print_jobs);
302+
if (DriverSkipExecution) {
300303
return llvm::make_unique<sys::DummyTaskQueue>(NumberOfParallelCommands);
301304
} else {
302305
return llvm::make_unique<sys::TaskQueue>(NumberOfParallelCommands,
@@ -656,9 +659,6 @@ Driver::buildCompilation(const ToolChain &TC,
656659
bool DriverPrintDerivedOutputFileMap =
657660
ArgList->hasArg(options::OPT_driver_print_derived_output_file_map);
658661
DriverPrintBindings = ArgList->hasArg(options::OPT_driver_print_bindings);
659-
bool DriverSkipExecution =
660-
ArgList->hasArg(options::OPT_driver_skip_execution,
661-
options::OPT_driver_print_jobs);
662662
bool ShowIncrementalBuildDecisions =
663663
ArgList->hasArg(options::OPT_driver_show_incremental);
664664
bool ShowJobLifecycle =
@@ -843,7 +843,6 @@ Driver::buildCompilation(const ToolChain &TC,
843843
BatchMode,
844844
DriverBatchSeed,
845845
DriverForceOneBatchRepartition,
846-
DriverSkipExecution,
847846
SaveTemps,
848847
ShowDriverTimeCompilation,
849848
std::move(StatsReporter)));

0 commit comments

Comments
 (0)