-
Notifications
You must be signed in to change notification settings - Fork 848
Expand file tree
/
Copy pathAction.cpp
More file actions
639 lines (510 loc) · 22.4 KB
/
Copy pathAction.cpp
File metadata and controls
639 lines (510 loc) · 22.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
//===- Action.cpp - Abstract compilation steps ----------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include "clang/Driver/Action.h"
#include "llvm/Support/ErrorHandling.h"
#include <cassert>
#include <string>
using namespace clang;
using namespace driver;
using namespace llvm::opt;
Action::~Action() = default;
const char *Action::getClassName(ActionClass AC) {
switch (AC) {
case InputClass: return "input";
case BindArchClass: return "bind-arch";
case OffloadClass:
return "offload";
case PreprocessJobClass: return "preprocessor";
case PrecompileJobClass: return "precompiler";
case ExtractAPIJobClass:
return "api-extractor";
case AnalyzeJobClass:
return "analyzer";
case CompileJobClass: return "compiler";
case BackendJobClass: return "backend";
case AssembleJobClass: return "assembler";
case IfsMergeJobClass: return "interface-stub-merger";
case LinkJobClass: return "linker";
case LipoJobClass: return "lipo";
case DsymutilJobClass: return "dsymutil";
case VerifyDebugInfoJobClass: return "verify-debug-info";
case VerifyPCHJobClass: return "verify-pch";
case OffloadBundlingJobClass:
return "clang-offload-bundler";
case OffloadUnbundlingJobClass:
return "clang-offload-unbundler";
case OffloadWrapperJobClass:
return "clang-offload-wrapper";
case OffloadPackagerJobClass:
return "llvm-offload-binary";
case OffloadPackagerExtractJobClass:
return "llvm-offload-binary-extract";
case OffloadDepsJobClass:
return "clang-offload-deps";
case SPIRVTranslatorJobClass:
return "llvm-spirv";
case SYCLPostLinkJobClass:
return "sycl-post-link";
case BackendCompileJobClass:
return "backend-compiler";
case FileTableTformJobClass:
return "file-table-tform";
case AppendFooterJobClass:
return "append-footer";
case LinkerWrapperJobClass:
return "clang-linker-wrapper";
case StaticLibJobClass:
return "static-lib-linker";
case ForEachWrappingClass:
return "foreach";
case SpirvToIrWrapperJobClass:
return "spirv-to-ir-wrapper";
case BinaryAnalyzeJobClass:
return "binary-analyzer";
case BinaryTranslatorJobClass:
return "binary-translator";
case ObjcopyJobClass:
return "objcopy";
}
llvm_unreachable("invalid class");
}
void Action::propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch,
const ToolChain *OToolChain) {
// Offload action set its own kinds on their dependences.
if (Kind == OffloadClass)
return;
// Unbundling actions use the host kinds.
if (Kind == OffloadUnbundlingJobClass)
return;
// Deps job uses the host kinds.
if (Kind == OffloadDepsJobClass)
return;
// Packaging actions can use host kinds for preprocessing or generating
// PCH files. When packaging such files, these packaged files will contain
// both host and device files, where the host side does not have any device
// info to propagate.
bool hasPreprocessOrPCHJob =
std::any_of(Inputs.begin(), Inputs.end(), [](const Action *A) {
return A->getKind() == PreprocessJobClass ||
A->getKind() == PrecompileJobClass;
});
if (Kind == OffloadPackagerJobClass && hasPreprocessOrPCHJob)
return;
assert((OffloadingDeviceKind == OKind || OffloadingDeviceKind == OFK_None) &&
"Setting device kind to a different device??");
assert(!ActiveOffloadKindMask && "Setting a device kind in a host action??");
OffloadingDeviceKind = OKind;
OffloadingArch = OArch;
OffloadingToolChain = OToolChain;
for (auto *A : Inputs)
A->propagateDeviceOffloadInfo(OffloadingDeviceKind, OArch, OToolChain);
}
void Action::propagateHostOffloadInfo(unsigned OKinds, const char *OArch) {
// Offload action set its own kinds on their dependences.
if (Kind == OffloadClass)
return;
assert(OffloadingDeviceKind == OFK_None &&
"Setting a host kind in a device action.");
ActiveOffloadKindMask |= OKinds;
OffloadingArch = OArch;
for (auto *A : Inputs)
A->propagateHostOffloadInfo(ActiveOffloadKindMask, OArch);
}
void Action::propagateOffloadInfo(const Action *A) {
if (unsigned HK = A->getOffloadingHostActiveKinds())
propagateHostOffloadInfo(HK, A->getOffloadingArch());
else
propagateDeviceOffloadInfo(A->getOffloadingDeviceKind(),
A->getOffloadingArch(),
A->getOffloadingToolChain());
}
std::string Action::getOffloadingKindPrefix() const {
switch (OffloadingDeviceKind) {
case OFK_None:
break;
case OFK_Host:
llvm_unreachable("Host kind is not an offloading device kind.");
break;
case OFK_Cuda:
return "device-cuda";
case OFK_OpenMP:
return "device-openmp";
case OFK_HIP:
return "device-hip";
case OFK_SYCL:
return "device-sycl";
// TODO: Add other programming models here.
}
if (!ActiveOffloadKindMask)
return {};
std::string Res("host");
assert(!((ActiveOffloadKindMask & OFK_Cuda) &&
(ActiveOffloadKindMask & OFK_HIP)) &&
"Cannot offload CUDA and HIP at the same time");
if (ActiveOffloadKindMask & OFK_Cuda)
Res += "-cuda";
if (ActiveOffloadKindMask & OFK_HIP)
Res += "-hip";
if (ActiveOffloadKindMask & OFK_OpenMP)
Res += "-openmp";
if (ActiveOffloadKindMask & OFK_SYCL)
Res += "-sycl";
// TODO: Add other programming models here.
return Res;
}
/// Return a string that can be used as prefix in order to generate unique files
/// for each offloading kind.
std::string
Action::GetOffloadingFileNamePrefix(OffloadKind Kind,
StringRef NormalizedTriple,
bool CreatePrefixForHost) {
// Don't generate prefix for host actions unless required.
if (!CreatePrefixForHost && (Kind == OFK_None || Kind == OFK_Host))
return {};
std::string Res("-");
Res += GetOffloadKindName(Kind);
Res += "-";
Res += NormalizedTriple;
return Res;
}
/// Return a string with the offload kind name. If that is not defined, we
/// assume 'host'.
StringRef Action::GetOffloadKindName(OffloadKind Kind) {
switch (Kind) {
case OFK_None:
case OFK_Host:
return "host";
case OFK_Cuda:
return "cuda";
case OFK_OpenMP:
return "openmp";
case OFK_HIP:
return "hip";
case OFK_SYCL:
return "sycl";
// TODO: Add other programming models here.
}
llvm_unreachable("invalid offload kind");
}
void InputAction::anchor() {}
InputAction::InputAction(const Arg &_Input, types::ID _Type, StringRef _Id)
: Action(InputClass, _Type), Input(_Input), Id(_Id.str()) {}
void BindArchAction::anchor() {}
BindArchAction::BindArchAction(Action *Input, StringRef ArchName)
: Action(BindArchClass, Input), ArchName(ArchName) {}
void OffloadAction::anchor() {}
OffloadAction::OffloadAction(const HostDependence &HDep)
: Action(OffloadClass, HDep.getAction()), HostTC(HDep.getToolChain()) {
OffloadingArch = HDep.getBoundArch();
ActiveOffloadKindMask = HDep.getOffloadKinds();
HDep.getAction()->propagateHostOffloadInfo(HDep.getOffloadKinds(),
HDep.getBoundArch());
}
OffloadAction::OffloadAction(const DeviceDependences &DDeps, types::ID Ty)
: Action(OffloadClass, DDeps.getActions(), Ty),
DevToolChains(DDeps.getToolChains()) {
auto &OKinds = DDeps.getOffloadKinds();
auto &BArchs = DDeps.getBoundArchs();
auto &OTCs = DDeps.getToolChains();
// If all inputs agree on the same kind, use it also for this action.
if (llvm::all_equal(OKinds))
OffloadingDeviceKind = OKinds.front();
// If we have a single dependency, inherit the architecture from it.
if (OKinds.size() == 1)
OffloadingArch = BArchs.front();
// Propagate info to the dependencies.
for (unsigned i = 0, e = getInputs().size(); i != e; ++i)
getInputs()[i]->propagateDeviceOffloadInfo(OKinds[i], BArchs[i], OTCs[i]);
}
OffloadAction::OffloadAction(const HostDependence &HDep,
const DeviceDependences &DDeps)
: Action(OffloadClass, HDep.getAction()), HostTC(HDep.getToolChain()),
DevToolChains(DDeps.getToolChains()) {
// We use the kinds of the host dependence for this action.
OffloadingArch = HDep.getBoundArch();
ActiveOffloadKindMask = HDep.getOffloadKinds();
HDep.getAction()->propagateHostOffloadInfo(HDep.getOffloadKinds(),
HDep.getBoundArch());
// Add device inputs and propagate info to the device actions. Do work only if
// we have dependencies.
for (unsigned i = 0, e = DDeps.getActions().size(); i != e; ++i) {
if (auto *A = DDeps.getActions()[i]) {
getInputs().push_back(A);
A->propagateDeviceOffloadInfo(DDeps.getOffloadKinds()[i],
DDeps.getBoundArchs()[i],
DDeps.getToolChains()[i]);
// If this action is used to forward single dependency, set the toolchain.
if (DDeps.getActions().size() == 1)
OffloadingToolChain = DDeps.getToolChains()[i];
}
}
}
void OffloadAction::doOnHostDependence(const OffloadActionWorkTy &Work) const {
if (!HostTC)
return;
assert(!getInputs().empty() && "No dependencies for offload action??");
auto *A = getInputs().front();
Work(A, HostTC, A->getOffloadingArch());
}
void OffloadAction::doOnEachDeviceDependence(
const OffloadActionWorkTy &Work) const {
auto I = getInputs().begin();
auto E = getInputs().end();
if (I == E)
return;
// We expect to have the same number of input dependences and device tool
// chains, except if we also have a host dependence. In that case we have one
// more dependence than we have device tool chains.
assert(getInputs().size() == DevToolChains.size() + (HostTC ? 1 : 0) &&
"Sizes of action dependences and toolchains are not consistent!");
// Skip host action
if (HostTC)
++I;
auto TI = DevToolChains.begin();
for (; I != E; ++I, ++TI)
Work(*I, *TI, (*I)->getOffloadingArch());
}
void OffloadAction::doOnEachDependence(const OffloadActionWorkTy &Work) const {
doOnHostDependence(Work);
doOnEachDeviceDependence(Work);
}
void OffloadAction::doOnEachDependence(bool IsHostDependence,
const OffloadActionWorkTy &Work) const {
if (IsHostDependence)
doOnHostDependence(Work);
else
doOnEachDeviceDependence(Work);
}
bool OffloadAction::hasHostDependence() const { return HostTC != nullptr; }
Action *OffloadAction::getHostDependence() const {
assert(hasHostDependence() && "Host dependence does not exist!");
assert(!getInputs().empty() && "No dependencies for offload action??");
return HostTC ? getInputs().front() : nullptr;
}
bool OffloadAction::hasSingleDeviceDependence(
bool DoNotConsiderHostActions) const {
if (DoNotConsiderHostActions)
return getInputs().size() == (HostTC ? 2 : 1);
return !HostTC && getInputs().size() == 1;
}
Action *
OffloadAction::getSingleDeviceDependence(bool DoNotConsiderHostActions) const {
assert(hasSingleDeviceDependence(DoNotConsiderHostActions) &&
"Single device dependence does not exist!");
// The previous assert ensures the number of entries in getInputs() is
// consistent with what we are doing here.
return HostTC ? getInputs()[1] : getInputs().front();
}
void OffloadAction::DeviceDependences::add(Action &A, const ToolChain &TC,
const char *BoundArch,
OffloadKind OKind) {
DeviceActions.push_back(&A);
DeviceToolChains.push_back(&TC);
DeviceBoundArchs.push_back(BoundArch);
DeviceOffloadKinds.push_back(OKind);
}
void OffloadAction::DeviceDependences::add(Action &A, const ToolChain &TC,
const char *BoundArch,
unsigned OffloadKindMask) {
DeviceActions.push_back(&A);
DeviceToolChains.push_back(&TC);
DeviceBoundArchs.push_back(BoundArch);
// Add each active offloading kind from a mask.
for (OffloadKind OKind : {OFK_OpenMP, OFK_Cuda, OFK_HIP, OFK_SYCL})
if (OKind & OffloadKindMask)
DeviceOffloadKinds.push_back(OKind);
}
OffloadAction::HostDependence::HostDependence(Action &A, const ToolChain &TC,
const char *BoundArch,
const DeviceDependences &DDeps)
: HostAction(A), HostToolChain(TC), HostBoundArch(BoundArch) {
for (auto K : DDeps.getOffloadKinds())
HostOffloadKinds |= K;
}
void JobAction::anchor() {}
JobAction::JobAction(ActionClass Kind, Action *Input, types::ID Type)
: Action(Kind, Input, Type) {}
JobAction::JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type)
: Action(Kind, Inputs, Type) {}
void PreprocessJobAction::anchor() {}
PreprocessJobAction::PreprocessJobAction(Action *Input, types::ID OutputType)
: JobAction(PreprocessJobClass, Input, OutputType) {}
void PrecompileJobAction::anchor() {}
PrecompileJobAction::PrecompileJobAction(Action *Input, types::ID OutputType)
: JobAction(PrecompileJobClass, Input, OutputType) {}
PrecompileJobAction::PrecompileJobAction(ActionClass Kind, Action *Input,
types::ID OutputType)
: JobAction(Kind, Input, OutputType) {
assert(isa<PrecompileJobAction>((Action*)this) && "invalid action kind");
}
void ExtractAPIJobAction::anchor() {}
ExtractAPIJobAction::ExtractAPIJobAction(Action *Inputs, types::ID OutputType)
: JobAction(ExtractAPIJobClass, Inputs, OutputType) {}
void AnalyzeJobAction::anchor() {}
AnalyzeJobAction::AnalyzeJobAction(Action *Input, types::ID OutputType)
: JobAction(AnalyzeJobClass, Input, OutputType) {}
void CompileJobAction::anchor() {}
CompileJobAction::CompileJobAction(Action *Input, types::ID OutputType)
: JobAction(CompileJobClass, Input, OutputType) {}
void BackendJobAction::anchor() {}
BackendJobAction::BackendJobAction(Action *Input, types::ID OutputType)
: JobAction(BackendJobClass, Input, OutputType) {}
void AssembleJobAction::anchor() {}
AssembleJobAction::AssembleJobAction(Action *Input, types::ID OutputType)
: JobAction(AssembleJobClass, Input, OutputType) {}
void IfsMergeJobAction::anchor() {}
IfsMergeJobAction::IfsMergeJobAction(ActionList &Inputs, types::ID Type)
: JobAction(IfsMergeJobClass, Inputs, Type) {}
void LinkJobAction::anchor() {}
LinkJobAction::LinkJobAction(ActionList &Inputs, types::ID Type)
: JobAction(LinkJobClass, Inputs, Type) {}
void LipoJobAction::anchor() {}
LipoJobAction::LipoJobAction(ActionList &Inputs, types::ID Type)
: JobAction(LipoJobClass, Inputs, Type) {}
void DsymutilJobAction::anchor() {}
DsymutilJobAction::DsymutilJobAction(ActionList &Inputs, types::ID Type)
: JobAction(DsymutilJobClass, Inputs, Type) {}
void VerifyJobAction::anchor() {}
VerifyJobAction::VerifyJobAction(ActionClass Kind, Action *Input,
types::ID Type)
: JobAction(Kind, Input, Type) {
assert((Kind == VerifyDebugInfoJobClass || Kind == VerifyPCHJobClass) &&
"ActionClass is not a valid VerifyJobAction");
}
void VerifyDebugInfoJobAction::anchor() {}
VerifyDebugInfoJobAction::VerifyDebugInfoJobAction(Action *Input,
types::ID Type)
: VerifyJobAction(VerifyDebugInfoJobClass, Input, Type) {}
void VerifyPCHJobAction::anchor() {}
VerifyPCHJobAction::VerifyPCHJobAction(Action *Input, types::ID Type)
: VerifyJobAction(VerifyPCHJobClass, Input, Type) {}
void OffloadBundlingJobAction::anchor() {}
OffloadBundlingJobAction::OffloadBundlingJobAction(ActionList &Inputs)
: JobAction(OffloadBundlingJobClass, Inputs, Inputs.back()->getType()) {}
void OffloadUnbundlingJobAction::anchor() {}
OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(Action *Input)
: JobAction(OffloadUnbundlingJobClass, Input, Input->getType()) {}
OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(Action *Input,
types::ID Type)
: JobAction(OffloadUnbundlingJobClass, Input, Type) {}
OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(ActionList &Inputs,
types::ID Type)
: JobAction(OffloadUnbundlingJobClass, Inputs, Type) {}
void OffloadWrapperJobAction::anchor() {}
OffloadWrapperJobAction::OffloadWrapperJobAction(ActionList &Inputs,
types::ID Type)
: JobAction(OffloadWrapperJobClass, Inputs, Type), EmbedIR(false) {}
OffloadWrapperJobAction::OffloadWrapperJobAction(Action *Input, types::ID Type,
bool IsEmbeddedIR)
: JobAction(OffloadWrapperJobClass, Input, Type), EmbedIR(IsEmbeddedIR) {}
void OffloadPackagerJobAction::anchor() {}
OffloadPackagerJobAction::OffloadPackagerJobAction(ActionList &Inputs,
types::ID Type)
: JobAction(OffloadPackagerJobClass, Inputs, Type) {}
void OffloadPackagerExtractJobAction::anchor() {}
OffloadPackagerExtractJobAction::OffloadPackagerExtractJobAction(
ActionList &Inputs, types::ID Type, const clang::driver::ToolChain *TC)
: JobAction(OffloadPackagerExtractJobClass, Inputs, Type),
OPEToolChain(TC) {}
void OffloadDepsJobAction::anchor() {}
OffloadDepsJobAction::OffloadDepsJobAction(
const OffloadAction::HostDependence &HDep, types::ID Type)
: JobAction(OffloadDepsJobClass, HDep.getAction(), Type),
HostTC(HDep.getToolChain()) {
OffloadingArch = HDep.getBoundArch();
ActiveOffloadKindMask = HDep.getOffloadKinds();
HDep.getAction()->propagateHostOffloadInfo(HDep.getOffloadKinds(),
HDep.getBoundArch());
}
void SPIRVTranslatorJobAction::anchor() {}
SPIRVTranslatorJobAction::SPIRVTranslatorJobAction(Action *Input,
types::ID Type)
: JobAction(SPIRVTranslatorJobClass, Input, Type) {}
void SYCLPostLinkJobAction::anchor() {}
SYCLPostLinkJobAction::SYCLPostLinkJobAction(Action *Input,
types::ID ShadowOutputType,
types::ID TrueOutputType)
: JobAction(SYCLPostLinkJobClass, Input, ShadowOutputType),
TrueOutputType(TrueOutputType) {}
void BackendCompileJobAction::anchor() {}
BackendCompileJobAction::BackendCompileJobAction(ActionList &Inputs,
types::ID Type)
: JobAction(BackendCompileJobClass, Inputs, Type) {}
BackendCompileJobAction::BackendCompileJobAction(Action *Input,
types::ID Type)
: JobAction(BackendCompileJobClass, Input, Type) {}
void FileTableTformJobAction::anchor() {}
FileTableTformJobAction::FileTableTformJobAction(Action *Input,
types::ID ShadowOutputType,
types::ID TrueOutputType)
: JobAction(FileTableTformJobClass, Input, ShadowOutputType),
TrueOutputType(TrueOutputType) {}
FileTableTformJobAction::FileTableTformJobAction(ActionList &Inputs,
types::ID ShadowOutputType,
types::ID TrueOutputType)
: JobAction(FileTableTformJobClass, Inputs, ShadowOutputType),
TrueOutputType(TrueOutputType) {}
void FileTableTformJobAction::addExtractColumnTform(StringRef ColumnName,
bool WithColTitle) {
auto K = WithColTitle ? Tform::EXTRACT : Tform::EXTRACT_DROP_TITLE;
Tforms.emplace_back(Tform(K, {ColumnName}));
}
void FileTableTformJobAction::addReplaceColumnTform(StringRef From,
StringRef To) {
Tforms.emplace_back(Tform(Tform::REPLACE, {From, To}));
}
void FileTableTformJobAction::addReplaceCellTform(StringRef ColumnName,
int Row) {
Tforms.emplace_back(
Tform(Tform::REPLACE_CELL, {ColumnName, std::to_string(Row)}));
}
void FileTableTformJobAction::addRenameColumnTform(StringRef From,
StringRef To) {
Tforms.emplace_back(Tform(Tform::RENAME, {From, To}));
}
void FileTableTformJobAction::addCopySingleFileTform(StringRef ColumnName,
int Row) {
Tforms.emplace_back(
Tform(Tform::COPY_SINGLE_FILE, {ColumnName, std::to_string(Row)}));
}
void FileTableTformJobAction::addMergeTform(StringRef ColumnName) {
Tforms.emplace_back(Tform(Tform::MERGE, {ColumnName}));
}
void AppendFooterJobAction::anchor() {}
AppendFooterJobAction::AppendFooterJobAction(Action *Input, types::ID Type)
: JobAction(AppendFooterJobClass, Input, Type) {}
void LinkerWrapperJobAction::anchor() {}
LinkerWrapperJobAction::LinkerWrapperJobAction(ActionList &Inputs,
types::ID Type)
: JobAction(LinkerWrapperJobClass, Inputs, Type) {}
void StaticLibJobAction::anchor() {}
StaticLibJobAction::StaticLibJobAction(ActionList &Inputs, types::ID Type)
: JobAction(StaticLibJobClass, Inputs, Type) {}
void SpirvToIrWrapperJobAction::anchor() {}
SpirvToIrWrapperJobAction::SpirvToIrWrapperJobAction(Action *Input,
types::ID Type)
: JobAction(SpirvToIrWrapperJobClass, Input, Type) {}
ForEachWrappingAction::ForEachWrappingAction(JobAction *TFormInput,
JobAction *Job)
: Action(ForEachWrappingClass, {TFormInput, Job}, Job->getType()) {}
JobAction *ForEachWrappingAction::getTFormInput() const {
return llvm::cast<JobAction>(getInputs()[0]);
}
JobAction *ForEachWrappingAction::getJobAction() const {
return llvm::cast<JobAction>(getInputs()[1]);
}
void BinaryAnalyzeJobAction::anchor() {}
BinaryAnalyzeJobAction::BinaryAnalyzeJobAction(Action *Input, types::ID Type)
: JobAction(BinaryAnalyzeJobClass, Input, Type) {}
void BinaryTranslatorJobAction::anchor() {}
BinaryTranslatorJobAction::BinaryTranslatorJobAction(Action *Input,
types::ID Type)
: JobAction(BinaryTranslatorJobClass, Input, Type) {}
void ObjcopyJobAction::anchor() {}
ObjcopyJobAction::ObjcopyJobAction(Action *Input, types::ID Type)
: JobAction(ObjcopyJobClass, Input, Type) {}