Skip to content

Commit 7686a5a

Browse files
committed
[BatchMode] Fix a bug in DummyTaskQueue uncovered by recent change.
1 parent 57fe9ee commit 7686a5a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

include/swift/Basic/TaskQueue.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class TaskQueue {
150150

151151
/// Returns true if there are any tasks that have been queued but have not
152152
/// yet been executed.
153-
bool hasRemainingTasks() {
153+
virtual bool hasRemainingTasks() {
154154
return !QueuedTasks.empty();
155155
}
156156
};
@@ -180,14 +180,20 @@ class DummyTaskQueue : public TaskQueue {
180180
DummyTaskQueue(unsigned NumberOfParallelTasks = 0);
181181
virtual ~DummyTaskQueue();
182182

183-
virtual void addTask(const char *ExecPath, ArrayRef<const char *> Args,
184-
ArrayRef<const char *> Env = llvm::None,
185-
void *Context = nullptr, bool SeparateErrors = false);
183+
void addTask(const char *ExecPath, ArrayRef<const char *> Args,
184+
ArrayRef<const char *> Env = llvm::None,
185+
void *Context = nullptr, bool SeparateErrors = false) override;
186186

187-
virtual bool
187+
bool
188188
execute(TaskBeganCallback Began = TaskBeganCallback(),
189189
TaskFinishedCallback Finished = TaskFinishedCallback(),
190-
TaskSignalledCallback Signalled = TaskSignalledCallback());
190+
TaskSignalledCallback Signalled = TaskSignalledCallback()) override;
191+
192+
bool hasRemainingTasks() override {
193+
// Need to override here because QueuedTasks is redeclared.
194+
return !QueuedTasks.empty();
195+
}
196+
191197
};
192198

193199
} // end namespace sys

0 commit comments

Comments
 (0)