@@ -127,7 +127,7 @@ class JobAction : public Action {
127127 }
128128};
129129
130- class CompileJobAction : public JobAction {
130+ class IncrementalJobAction : public JobAction {
131131public:
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
155157public:
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 }
0 commit comments