Skip to content

Commit e5737bc

Browse files
committed
[NFC] Insert IncrementalJobAction into the Action Hierarchy
This will be used to extend incremental behavior to merge-modules and the bridging header precompile step.
1 parent d70f35d commit e5737bc

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

include/swift/Driver/Action.h

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class JobAction : public Action {
127127
}
128128
};
129129

130-
class CompileJobAction : public JobAction {
130+
class IncrementalJobAction : public JobAction {
131131
public:
132132
struct InputInfo {
133133
enum Status {
@@ -136,6 +136,8 @@ class CompileJobAction : public JobAction {
136136
NeedsNonCascadingBuild,
137137
NewlyAdded
138138
};
139+
140+
public:
139141
Status status = UpToDate;
140142
llvm::sys::TimePoint<> previousModTime;
141143

@@ -153,18 +155,32 @@ class CompileJobAction : public JobAction {
153155
InputInfo inputInfo;
154156

155157
public:
156-
CompileJobAction(file_types::ID OutputType)
157-
: JobAction(Action::Kind::CompileJob, None, OutputType),
158-
inputInfo() {}
159-
160-
CompileJobAction(Action *Input, file_types::ID OutputType, InputInfo info)
161-
: JobAction(Action::Kind::CompileJob, Input, OutputType),
162-
inputInfo(info) {}
158+
IncrementalJobAction(Kind Kind, ArrayRef<const Action *> Inputs,
159+
file_types::ID Type, InputInfo info)
160+
: JobAction(Kind, Inputs, Type), inputInfo(info) {}
163161

162+
public:
164163
InputInfo getInputInfo() const {
165164
return inputInfo;
166165
}
167166

167+
public:
168+
static bool classof(const Action *A) {
169+
return A->getKind() == Action::Kind::CompileJob;
170+
}
171+
};
172+
173+
class CompileJobAction : public IncrementalJobAction {
174+
private:
175+
virtual void anchor() override;
176+
177+
public:
178+
CompileJobAction(file_types::ID OutputType)
179+
: IncrementalJobAction(Action::Kind::CompileJob, None, OutputType, {}) {}
180+
CompileJobAction(Action *Input, file_types::ID OutputType, InputInfo info)
181+
: IncrementalJobAction(Action::Kind::CompileJob, Input, OutputType,
182+
info) {}
183+
168184
static bool classof(const Action *A) {
169185
return A->getKind() == Action::Kind::CompileJob;
170186
}

lib/Driver/Action.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ void InputAction::anchor() {}
4343

4444
void JobAction::anchor() {}
4545

46+
void IncrementalJobAction::anchor() {}
47+
4648
void CompileJobAction::anchor() {}
4749

4850
void InterpretJobAction::anchor() {}

0 commit comments

Comments
 (0)