15
15
16
16
#include " swift/Basic/LLVM.h"
17
17
#include " swift/Driver/Util.h"
18
- #include " swift/Frontend/Types .h"
18
+ #include " swift/Frontend/FileTypes .h"
19
19
#include " llvm/ADT/ArrayRef.h"
20
20
#include " llvm/ADT/Optional.h"
21
21
#include " llvm/ADT/StringSwitch.h"
@@ -67,8 +67,7 @@ class Action {
67
67
void *operator new (size_t size) { return ::operator new (size); };
68
68
69
69
protected:
70
- Action (ActionClass Kind, types::ID Type)
71
- : Kind(Kind), Type(Type) {
70
+ Action (ActionClass Kind, file_types::ID Type) : Kind(Kind), Type(Type) {
72
71
assert (Kind == getKind () && " not enough bits" );
73
72
assert (Type == getType () && " not enough bits" );
74
73
}
@@ -79,15 +78,15 @@ class Action {
79
78
const char *getClassName () const { return Action::getClassName (getKind ()); }
80
79
81
80
ActionClass getKind () const { return static_cast <ActionClass>(Kind); }
82
- types ::ID getType () const { return static_cast <types ::ID>(Type); }
81
+ file_types ::ID getType () const { return static_cast <file_types ::ID>(Type); }
83
82
};
84
83
85
84
class InputAction : public Action {
86
85
virtual void anchor ();
87
86
const llvm::opt::Arg &Input;
88
87
89
88
public:
90
- InputAction (const llvm::opt::Arg &Input, types ::ID Type)
89
+ InputAction (const llvm::opt::Arg &Input, file_types ::ID Type)
91
90
: Action(Action::Input, Type), Input(Input) {}
92
91
const llvm::opt::Arg &getInputArg () const { return Input; }
93
92
@@ -100,7 +99,8 @@ class JobAction : public Action {
100
99
TinyPtrVector<const Action *> Inputs;
101
100
virtual void anchor ();
102
101
protected:
103
- JobAction (ActionClass Kind, ArrayRef<const Action *> Inputs, types::ID Type)
102
+ JobAction (ActionClass Kind, ArrayRef<const Action *> Inputs,
103
+ file_types::ID Type)
104
104
: Action(Kind, Type), Inputs(Inputs) {}
105
105
106
106
public:
@@ -151,13 +151,11 @@ class CompileJobAction : public JobAction {
151
151
InputInfo inputInfo;
152
152
153
153
public:
154
- CompileJobAction (types ::ID OutputType)
154
+ CompileJobAction (file_types ::ID OutputType)
155
155
: JobAction(Action::CompileJob, None, OutputType), inputInfo() {}
156
156
157
- CompileJobAction (Action *Input, types::ID OutputType,
158
- InputInfo info)
159
- : JobAction(Action::CompileJob, Input, OutputType),
160
- inputInfo (info) {}
157
+ CompileJobAction (Action *Input, file_types::ID OutputType, InputInfo info)
158
+ : JobAction(Action::CompileJob, Input, OutputType), inputInfo(info) {}
161
159
162
160
InputInfo getInputInfo () const {
163
161
return inputInfo;
@@ -174,7 +172,7 @@ class InterpretJobAction : public JobAction {
174
172
175
173
public:
176
174
explicit InterpretJobAction ()
177
- : JobAction(Action::InterpretJob, llvm::None, types ::TY_Nothing) {}
175
+ : JobAction(Action::InterpretJob, llvm::None, file_types ::TY_Nothing) {}
178
176
179
177
static bool classof (const Action *A) {
180
178
return A->getKind () == Action::InterpretJob;
@@ -190,7 +188,8 @@ class BackendJobAction : public JobAction {
190
188
// This index specifies which of the files to select for the input.
191
189
size_t InputIndex;
192
190
public:
193
- BackendJobAction (const Action *Input, types::ID OutputType, size_t InputIndex)
191
+ BackendJobAction (const Action *Input, file_types::ID OutputType,
192
+ size_t InputIndex)
194
193
: JobAction(Action::BackendJob, Input, OutputType),
195
194
InputIndex (InputIndex) {}
196
195
static bool classof (const Action *A) {
@@ -212,8 +211,8 @@ class REPLJobAction : public JobAction {
212
211
Mode RequestedMode;
213
212
public:
214
213
REPLJobAction (Mode mode)
215
- : JobAction(Action::REPLJob, llvm::None, types ::TY_Nothing),
216
- RequestedMode (mode) {}
214
+ : JobAction(Action::REPLJob, llvm::None, file_types ::TY_Nothing),
215
+ RequestedMode (mode) {}
217
216
218
217
Mode getRequestedMode () const { return RequestedMode; }
219
218
@@ -226,7 +225,8 @@ class MergeModuleJobAction : public JobAction {
226
225
virtual void anchor ();
227
226
public:
228
227
MergeModuleJobAction (ArrayRef<const Action *> Inputs)
229
- : JobAction(Action::MergeModuleJob, Inputs, types::TY_SwiftModuleFile) {}
228
+ : JobAction(Action::MergeModuleJob, Inputs,
229
+ file_types::TY_SwiftModuleFile) {}
230
230
231
231
static bool classof (const Action *A) {
232
232
return A->getKind () == Action::MergeModuleJob;
@@ -237,7 +237,7 @@ class ModuleWrapJobAction : public JobAction {
237
237
virtual void anchor ();
238
238
public:
239
239
ModuleWrapJobAction (ArrayRef<const Action *> Inputs)
240
- : JobAction(Action::ModuleWrapJob, Inputs, types ::TY_Object) {}
240
+ : JobAction(Action::ModuleWrapJob, Inputs, file_types ::TY_Object) {}
241
241
242
242
static bool classof (const Action *A) {
243
243
return A->getKind () == Action::ModuleWrapJob;
@@ -248,7 +248,8 @@ class AutolinkExtractJobAction : public JobAction {
248
248
virtual void anchor ();
249
249
public:
250
250
AutolinkExtractJobAction (ArrayRef<const Action *> Inputs)
251
- : JobAction(Action::AutolinkExtractJob, Inputs, types::TY_AutolinkFile) {}
251
+ : JobAction(Action::AutolinkExtractJob, Inputs,
252
+ file_types::TY_AutolinkFile) {}
252
253
253
254
static bool classof (const Action *A) {
254
255
return A->getKind () == Action::AutolinkExtractJob;
@@ -259,7 +260,7 @@ class GenerateDSYMJobAction : public JobAction {
259
260
virtual void anchor ();
260
261
public:
261
262
explicit GenerateDSYMJobAction (const Action *Input)
262
- : JobAction(Action::GenerateDSYMJob, Input, types ::TY_dSYM) {}
263
+ : JobAction(Action::GenerateDSYMJob, Input, file_types ::TY_dSYM) {}
263
264
264
265
static bool classof (const Action *A) {
265
266
return A->getKind () == Action::GenerateDSYMJob;
@@ -270,7 +271,7 @@ class VerifyDebugInfoJobAction : public JobAction {
270
271
virtual void anchor ();
271
272
public:
272
273
explicit VerifyDebugInfoJobAction (const Action *Input)
273
- : JobAction(Action::VerifyDebugInfoJob, Input, types ::TY_Nothing) {}
274
+ : JobAction(Action::VerifyDebugInfoJob, Input, file_types ::TY_Nothing) {}
274
275
275
276
static bool classof (const Action *A) {
276
277
return A->getKind () == Action::VerifyDebugInfoJob;
@@ -283,9 +284,10 @@ class GeneratePCHJobAction : public JobAction {
283
284
virtual void anchor ();
284
285
public:
285
286
GeneratePCHJobAction (const Action *Input, StringRef persistentPCHDir)
286
- : JobAction(Action::GeneratePCHJob, Input,
287
- persistentPCHDir.empty() ? types::TY_PCH : types::TY_Nothing),
288
- PersistentPCHDir (persistentPCHDir) {}
287
+ : JobAction(Action::GeneratePCHJob, Input,
288
+ persistentPCHDir.empty() ? file_types::TY_PCH
289
+ : file_types::TY_Nothing),
290
+ PersistentPCHDir (persistentPCHDir) {}
289
291
290
292
bool isPersistentPCH () const { return !PersistentPCHDir.empty (); }
291
293
StringRef getPersistentPCHDir () const { return PersistentPCHDir; }
@@ -301,7 +303,7 @@ class LinkJobAction : public JobAction {
301
303
302
304
public:
303
305
LinkJobAction (ArrayRef<const Action *> Inputs, LinkKind K)
304
- : JobAction(Action::LinkJob, Inputs, types ::TY_Image), Kind(K) {
306
+ : JobAction(Action::LinkJob, Inputs, file_types ::TY_Image), Kind(K) {
305
307
assert (Kind != LinkKind::None);
306
308
}
307
309
0 commit comments