clang 23.0.0git
Action.h
Go to the documentation of this file.
1//===- Action.h - Abstract compilation steps --------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_CLANG_DRIVER_ACTION_H
10#define LLVM_CLANG_DRIVER_ACTION_H
11
12#include "clang/Basic/LLVM.h"
14#include "clang/Driver/Types.h"
15#include "clang/Driver/Util.h"
16#include "llvm/ADT/ArrayRef.h"
17#include "llvm/ADT/STLExtras.h"
18#include "llvm/ADT/SmallVector.h"
19#include "llvm/ADT/StringRef.h"
20#include "llvm/ADT/iterator_range.h"
21#include <string>
22
23namespace llvm {
24namespace opt {
25
26class Arg;
27
28} // namespace opt
29} // namespace llvm
30
31namespace clang {
32namespace driver {
33
34class ToolChain;
35
36/// Action - Represent an abstract compilation step to perform.
37///
38/// An action represents an edge in the compilation graph; typically
39/// it is a job to transform an input using some tool.
40///
41/// The current driver is hard wired to expect actions which produce a
42/// single primary output, at least in terms of controlling the
43/// compilation. Actions can produce auxiliary files, but can only
44/// produce a single output to feed into subsequent actions.
45///
46/// Actions are usually owned by a Compilation, which creates new
47/// actions via MakeAction().
48class Action {
49public:
50 using size_type = ActionList::size_type;
51 using input_iterator = ActionList::iterator;
52 using input_const_iterator = ActionList::const_iterator;
53 using input_range = llvm::iterator_range<input_iterator>;
54 using input_const_range = llvm::iterator_range<input_const_iterator>;
55
85
86 // The offloading kind determines if this action is binded to a particular
87 // programming model. Each entry reserves one bit. We also have a special kind
88 // to designate the host offloading tool chain.
90 OFK_None = 0x00,
91
92 // The host offloading tool chain.
93 OFK_Host = 0x01,
94
95 // The device offloading tool chains - one bit for each programming model.
96 OFK_Cuda = 0x02,
97 OFK_OpenMP = 0x04,
98 OFK_HIP = 0x08,
99 OFK_SYCL = 0x10,
100
103 };
104
105 static const char *getClassName(ActionClass AC);
106
107private:
108 ActionClass Kind;
109
110 /// The output type of this action.
112
113 ActionList Inputs;
114
115 /// Flag that is set to true if this action can be collapsed with others
116 /// actions that depend on it. This is true by default and set to false when
117 /// the action is used by two different tool chains, which is enabled by the
118 /// offloading support implementation.
119 bool CanBeCollapsedWithNextDependentAction = true;
120
121protected:
122 ///
123 /// Offload information.
124 ///
125
126 /// The host offloading kind - a combination of kinds encoded in a mask.
127 /// Multiple programming models may be supported simultaneously by the same
128 /// host.
130
131 /// Offloading kind of the device.
133
134 /// The Offloading architecture associated with this action.
136
137 /// The Offloading toolchain associated with this device action.
139
140 Action(ActionClass Kind, types::ID Type) : Action(Kind, ActionList(), Type) {}
141 Action(ActionClass Kind, Action *Input, types::ID Type)
142 : Action(Kind, ActionList({Input}), Type) {}
144 : Action(Kind, ActionList({Input}), Input->getType()) {}
145 Action(ActionClass Kind, const ActionList &Inputs, types::ID Type)
146 : Kind(Kind), Type(Type), Inputs(Inputs) {}
147
148public:
149 virtual ~Action();
150
151 const char *getClassName() const { return Action::getClassName(getKind()); }
152
153 ActionClass getKind() const { return Kind; }
154 types::ID getType() const { return Type; }
155
156 ActionList &getInputs() { return Inputs; }
157 const ActionList &getInputs() const { return Inputs; }
158
159 size_type size() const { return Inputs.size(); }
160
161 input_iterator input_begin() { return Inputs.begin(); }
162 input_iterator input_end() { return Inputs.end(); }
164 input_const_iterator input_begin() const { return Inputs.begin(); }
165 input_const_iterator input_end() const { return Inputs.end(); }
169
170 /// Mark this action as not legal to collapse.
172 CanBeCollapsedWithNextDependentAction = false;
173 }
174
175 /// Return true if this function can be collapsed with others.
177 return CanBeCollapsedWithNextDependentAction;
178 }
179
180 /// Return a string containing the offload kind of the action.
181 std::string getOffloadingKindPrefix() const;
182
183 /// Return a string that can be used as prefix in order to generate unique
184 /// files for each offloading kind. By default, no prefix is used for
185 /// non-device kinds, except if \a CreatePrefixForHost is set.
186 static std::string
187 GetOffloadingFileNamePrefix(OffloadKind Kind,
188 StringRef NormalizedTriple,
189 bool CreatePrefixForHost = false);
190
191 /// Return a string containing a offload kind name.
192 static StringRef GetOffloadKindName(OffloadKind Kind);
193
194 /// Set the device offload info of this action and propagate it to its
195 /// dependences.
196 void propagateDeviceOffloadInfo(OffloadKind OKind, BoundArch OArch,
197 const ToolChain *OToolChain);
198
199 /// Append the host offload info of this action and propagate it to its
200 /// dependences.
201 void propagateHostOffloadInfo(unsigned OKinds, BoundArch OArch);
202
203 void setHostOffloadInfo(unsigned OKinds, BoundArch OArch) {
204 ActiveOffloadKindMask |= OKinds;
205 OffloadingArch = OArch;
206 }
207
208 /// Set the offload info of this action to be the same as the provided action,
209 /// and propagate it to its dependences.
210 void propagateOffloadInfo(const Action *A);
211
214 }
215
219 return OffloadingToolChain;
220 }
221
222 /// Check if this action have any offload kinds. Note that host offload kinds
223 /// are only set if the action is a dependence to a host offload action.
224 bool isHostOffloading(unsigned int OKind) const {
225 return ActiveOffloadKindMask & OKind;
226 }
227 bool isDeviceOffloading(OffloadKind OKind) const {
228 return OffloadingDeviceKind == OKind;
229 }
230 bool isOffloading(OffloadKind OKind) const {
231 return isHostOffloading(OKind) || isDeviceOffloading(OKind);
232 }
233};
234
235class InputAction : public Action {
236 const llvm::opt::Arg &Input;
237 std::string Id;
238 virtual void anchor();
239
240public:
241 InputAction(const llvm::opt::Arg &Input, types::ID Type,
242 StringRef Id = StringRef());
243
244 const llvm::opt::Arg &getInputArg() const { return Input; }
245
246 void setId(StringRef _Id) { Id = _Id.str(); }
247 StringRef getId() const { return Id; }
248
249 static bool classof(const Action *A) {
250 return A->getKind() == InputClass;
251 }
252};
253
254class BindArchAction : public Action {
255 virtual void anchor();
256
257 /// The architecture to bind, or empty if the default architecture
258 /// should be bound.
259 BoundArch ArchName;
260
261public:
262 BindArchAction(Action *Input, BoundArch ArchName);
263
264 BoundArch getArch() const { return ArchName; }
265
266 static bool classof(const Action *A) {
267 return A->getKind() == BindArchClass;
268 }
269};
270
271/// An offload action combines host or/and device actions according to the
272/// programming model implementation needs and propagates the offloading kind to
273/// its dependences.
274class OffloadAction final : public Action {
275 LLVM_DECLARE_VIRTUAL_ANCHOR_FUNCTION();
276
277public:
278 /// Type used to communicate device actions. It associates bound architecture,
279 /// toolchain, and offload kind to each action.
280 class DeviceDependences final {
281 public:
285
286 private:
287 // Lists that keep the information for each dependency. All the lists are
288 // meant to be updated in sync. We are adopting separate lists instead of a
289 // list of structs, because that simplifies forwarding the actions list to
290 // initialize the inputs of the base Action class.
291
292 /// The dependence actions.
293 ActionList DeviceActions;
294
295 /// The offloading toolchains that should be used with the action.
296 ToolChainList DeviceToolChains;
297
298 /// The architectures that should be used with this action.
299 BoundArchList DeviceBoundArchs;
300
301 /// The offload kind of each dependence.
302 OffloadKindList DeviceOffloadKinds;
303
304 public:
305 /// Add an action along with the associated toolchain, bound arch, and
306 /// offload kind.
307 void add(Action &A, const ToolChain &TC, BoundArch BA, OffloadKind OKind);
308
309 /// Add an action along with the associated toolchain, bound arch, and
310 /// offload kinds.
311 void add(Action &A, const ToolChain &TC, BoundArch BA,
312 unsigned OffloadKindMask);
313
314 /// Get each of the individual arrays.
315 const ActionList &getActions() const { return DeviceActions; }
316 const ToolChainList &getToolChains() const { return DeviceToolChains; }
317 const BoundArchList &getBoundArchs() const { return DeviceBoundArchs; }
319 return DeviceOffloadKinds;
320 }
321 };
322
323 /// Type used to communicate host actions. It associates bound architecture,
324 /// toolchain, and offload kinds to the host action.
325 class HostDependence final {
326 /// The dependence action.
327 Action &HostAction;
328
329 /// The offloading toolchain that should be used with the action.
330 const ToolChain &HostToolChain;
331
332 /// The architectures that should be used with this action.
333 BoundArch HostBoundArch;
334
335 /// The offload kind of each dependence.
336 unsigned HostOffloadKinds = 0u;
337
338 public:
340 const unsigned OffloadKinds)
341 : HostAction(A), HostToolChain(TC), HostBoundArch(BA),
342 HostOffloadKinds(OffloadKinds) {}
343
344 /// Constructor version that obtains the offload kinds from the device
345 /// dependencies.
347 const DeviceDependences &DDeps);
348 Action *getAction() const { return &HostAction; }
349 const ToolChain *getToolChain() const { return &HostToolChain; }
350 BoundArch getBoundArch() const { return HostBoundArch; }
351 unsigned getOffloadKinds() const { return HostOffloadKinds; }
352 };
353
355 llvm::function_ref<void(Action *, const ToolChain *, BoundArch)>;
356
357private:
358 /// The host offloading toolchain that should be used with the action.
359 const ToolChain *HostTC = nullptr;
360
361 /// The tool chains associated with the list of actions.
363
364public:
365 OffloadAction(const HostDependence &HDep);
366 OffloadAction(const DeviceDependences &DDeps, types::ID Ty);
367 OffloadAction(const HostDependence &HDep, const DeviceDependences &DDeps);
368
369 /// Execute the work specified in \a Work on the host dependence.
370 void doOnHostDependence(const OffloadActionWorkTy &Work) const;
371
372 /// Execute the work specified in \a Work on each device dependence.
373 void doOnEachDeviceDependence(const OffloadActionWorkTy &Work) const;
374
375 /// Execute the work specified in \a Work on each dependence.
376 void doOnEachDependence(const OffloadActionWorkTy &Work) const;
377
378 /// Execute the work specified in \a Work on each host or device dependence if
379 /// \a IsHostDependenceto is true or false, respectively.
380 void doOnEachDependence(bool IsHostDependence,
381 const OffloadActionWorkTy &Work) const;
382
383 /// Return true if the action has a host dependence.
384 bool hasHostDependence() const;
385
386 /// Return the host dependence of this action. This function is only expected
387 /// to be called if the host dependence exists.
388 Action *getHostDependence() const;
389
390 /// Return true if the action has a single device dependence. If \a
391 /// DoNotConsiderHostActions is set, ignore the host dependence, if any, while
392 /// accounting for the number of dependences.
393 bool hasSingleDeviceDependence(bool DoNotConsiderHostActions = false) const;
394
395 /// Return the single device dependence of this action. This function is only
396 /// expected to be called if a single device dependence exists. If \a
397 /// DoNotConsiderHostActions is set, a host dependence is allowed.
398 Action *
399 getSingleDeviceDependence(bool DoNotConsiderHostActions = false) const;
400
401 static bool classof(const Action *A) { return A->getKind() == OffloadClass; }
402};
403
404class JobAction : public Action {
405 virtual void anchor();
406
407protected:
408 JobAction(ActionClass Kind, Action *Input, types::ID Type);
409 JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type);
410
411public:
412 static bool classof(const Action *A) {
413 return (A->getKind() >= JobClassFirst &&
414 A->getKind() <= JobClassLast);
415 }
416};
417
419 void anchor() override;
420
421public:
422 PreprocessJobAction(Action *Input, types::ID OutputType);
423
424 static bool classof(const Action *A) {
425 return A->getKind() == PreprocessJobClass;
426 }
427};
428
430 void anchor() override;
431
432protected:
433 PrecompileJobAction(ActionClass Kind, Action *Input, types::ID OutputType);
434
435public:
436 PrecompileJobAction(Action *Input, types::ID OutputType);
437
438 static bool classof(const Action *A) {
439 return A->getKind() == PrecompileJobClass;
440 }
441};
442
444 void anchor() override;
445
446public:
447 ExtractAPIJobAction(Action *Input, types::ID OutputType);
448
449 static bool classof(const Action *A) {
450 return A->getKind() == ExtractAPIJobClass;
451 }
452
453 void addHeaderInput(Action *Input) { getInputs().push_back(Input); }
454};
455
457 void anchor() override;
458
459public:
460 AnalyzeJobAction(Action *Input, types::ID OutputType);
461
462 static bool classof(const Action *A) {
463 return A->getKind() == AnalyzeJobClass;
464 }
465};
466
468 void anchor() override;
469
470public:
471 CompileJobAction(Action *Input, types::ID OutputType);
472
473 static bool classof(const Action *A) {
474 return A->getKind() == CompileJobClass;
475 }
476};
477
479 void anchor() override;
480
481public:
482 BackendJobAction(Action *Input, types::ID OutputType);
483
484 static bool classof(const Action *A) {
485 return A->getKind() == BackendJobClass;
486 }
487};
488
490 void anchor() override;
491
492public:
493 AssembleJobAction(Action *Input, types::ID OutputType);
494
495 static bool classof(const Action *A) {
496 return A->getKind() == AssembleJobClass;
497 }
498};
499
501 void anchor() override;
502
503public:
505
506 static bool classof(const Action *A) {
507 return A->getKind() == IfsMergeJobClass;
508 }
509};
510
511class LinkJobAction : public JobAction {
512 void anchor() override;
513
514public:
515 LinkJobAction(ActionList &Inputs, types::ID Type);
516
517 static bool classof(const Action *A) {
518 return A->getKind() == LinkJobClass;
519 }
520};
521
522class LipoJobAction : public JobAction {
523 void anchor() override;
524
525public:
526 LipoJobAction(ActionList &Inputs, types::ID Type);
527
528 static bool classof(const Action *A) {
529 return A->getKind() == LipoJobClass;
530 }
531};
532
534 void anchor() override;
535
536public:
538
539 static bool classof(const Action *A) {
540 return A->getKind() == DsymutilJobClass;
541 }
542};
543
545 void anchor() override;
546
547public:
548 VerifyJobAction(ActionClass Kind, Action *Input, types::ID Type);
549
550 static bool classof(const Action *A) {
551 return A->getKind() == VerifyDebugInfoJobClass ||
553 }
554};
555
557 void anchor() override;
558
559public:
561
562 static bool classof(const Action *A) {
563 return A->getKind() == VerifyDebugInfoJobClass;
564 }
565};
566
568 void anchor() override;
569
570public:
571 VerifyPCHJobAction(Action *Input, types::ID Type);
572
573 static bool classof(const Action *A) {
574 return A->getKind() == VerifyPCHJobClass;
575 }
576};
577
579 void anchor() override;
580
581public:
582 // Offloading bundling doesn't change the type of output.
584
585 static bool classof(const Action *A) {
586 return A->getKind() == OffloadBundlingJobClass;
587 }
588};
589
591 void anchor() override;
592
593public:
594 /// Type that provides information about the actions that depend on this
595 /// unbundling action.
596 struct DependentActionInfo final {
597 /// The tool chain of the dependent action.
599
600 /// The bound architecture of the dependent action.
602
603 /// The offload kind of the dependent action.
605
612 };
613
614private:
615 /// Container that keeps information about each dependence of this unbundling
616 /// action.
617 SmallVector<DependentActionInfo, 6> DependentActionInfoArray;
618
619public:
620 // Offloading unbundling doesn't change the type of output.
622
623 /// Register information about a dependent action.
625 OffloadKind Kind) {
626 DependentActionInfoArray.push_back({TC, BA, Kind});
627 }
628
629 /// Return the information about all depending actions.
631 return DependentActionInfoArray;
632 }
633
634 static bool classof(const Action *A) {
635 return A->getKind() == OffloadUnbundlingJobClass;
636 }
637};
638
640 void anchor() override;
641
642public:
644
645 static bool classof(const Action *A) {
646 return A->getKind() == OffloadPackagerJobClass;
647 }
648};
649
651 void anchor() override;
652
653public:
655
656 static bool classof(const Action *A) {
657 return A->getKind() == LinkerWrapperJobClass;
658 }
659};
660
662 void anchor() override;
663
664public:
666
667 static bool classof(const Action *A) {
668 return A->getKind() == StaticLibJobClass;
669 }
670};
671
673 void anchor() override;
674
675public:
677
678 static bool classof(const Action *A) {
679 return A->getKind() == BinaryAnalyzeJobClass;
680 }
681};
682
684 void anchor() override;
685
686public:
688
689 static bool classof(const Action *A) {
690 return A->getKind() == BinaryTranslatorJobClass;
691 }
692};
693
695 void anchor() override;
696
697public:
698 ObjcopyJobAction(Action *Input, types::ID Type);
699
700 static bool classof(const Action *A) {
701 return A->getKind() == ObjcopyJobClass;
702 }
703};
704
705} // namespace driver
706} // namespace clang
707
708#endif // LLVM_CLANG_DRIVER_ACTION_H
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
The base class of the type hierarchy.
Definition TypeBase.h:1875
Action - Represent an abstract compilation step to perform.
Definition Action.h:48
input_const_iterator input_begin() const
Definition Action.h:164
OffloadKind OffloadingDeviceKind
Offloading kind of the device.
Definition Action.h:132
Action(ActionClass Kind, types::ID Type)
Definition Action.h:140
size_type size() const
Definition Action.h:159
bool isCollapsingWithNextDependentActionLegal() const
Return true if this function can be collapsed with others.
Definition Action.h:176
types::ID getType() const
Definition Action.h:154
void setCannotBeCollapsedWithNextDependentAction()
Mark this action as not legal to collapse.
Definition Action.h:171
std::string getOffloadingKindPrefix() const
Return a string containing the offload kind of the action.
Definition Action.cpp:105
ActionList::size_type size_type
Definition Action.h:50
const ToolChain * getOffloadingToolChain() const
Definition Action.h:218
input_iterator input_end()
Definition Action.h:162
const ToolChain * OffloadingToolChain
The Offloading toolchain associated with this device action.
Definition Action.h:138
Action(ActionClass Kind, Action *Input, types::ID Type)
Definition Action.h:141
static std::string GetOffloadingFileNamePrefix(OffloadKind Kind, StringRef NormalizedTriple, bool CreatePrefixForHost=false)
Return a string that can be used as prefix in order to generate unique files for each offloading kind...
Definition Action.cpp:148
BoundArch getOffloadingArch() const
Definition Action.h:217
Action(ActionClass Kind, Action *Input)
Definition Action.h:143
void propagateOffloadInfo(const Action *A)
Set the offload info of this action to be the same as the provided action, and propagate it to its de...
Definition Action.cpp:96
const ActionList & getInputs() const
Definition Action.h:157
ActionClass getKind() const
Definition Action.h:153
ActionList::iterator input_iterator
Definition Action.h:51
static StringRef GetOffloadKindName(OffloadKind Kind)
Return a string containing a offload kind name.
Definition Action.cpp:164
input_const_range inputs() const
Definition Action.h:166
const char * getClassName() const
Definition Action.h:151
OffloadKind getOffloadingDeviceKind() const
Definition Action.h:216
input_const_iterator input_end() const
Definition Action.h:165
input_iterator input_begin()
Definition Action.h:161
void propagateDeviceOffloadInfo(OffloadKind OKind, BoundArch OArch, const ToolChain *OToolChain)
Set the device offload info of this action and propagate it to its dependences.
Definition Action.cpp:62
unsigned ActiveOffloadKindMask
Offload information.
Definition Action.h:129
input_range inputs()
Definition Action.h:163
Action(ActionClass Kind, const ActionList &Inputs, types::ID Type)
Definition Action.h:145
bool isHostOffloading(unsigned int OKind) const
Check if this action have any offload kinds.
Definition Action.h:224
void propagateHostOffloadInfo(unsigned OKinds, BoundArch OArch)
Append the host offload info of this action and propagate it to its dependences.
Definition Action.cpp:82
bool isDeviceOffloading(OffloadKind OKind) const
Definition Action.h:227
BoundArch OffloadingArch
The Offloading architecture associated with this action.
Definition Action.h:135
void setHostOffloadInfo(unsigned OKinds, BoundArch OArch)
Definition Action.h:203
ActionList::const_iterator input_const_iterator
Definition Action.h:52
ActionList & getInputs()
Definition Action.h:156
llvm::iterator_range< input_iterator > input_range
Definition Action.h:53
llvm::iterator_range< input_const_iterator > input_const_range
Definition Action.h:54
unsigned getOffloadingHostActiveKinds() const
Definition Action.h:212
bool isOffloading(OffloadKind OKind) const
Definition Action.h:230
static bool classof(const Action *A)
Definition Action.h:462
AnalyzeJobAction(Action *Input, types::ID OutputType)
Definition Action.cpp:375
AssembleJobAction(Action *Input, types::ID OutputType)
Definition Action.cpp:390
static bool classof(const Action *A)
Definition Action.h:495
static bool classof(const Action *A)
Definition Action.h:484
BackendJobAction(Action *Input, types::ID OutputType)
Definition Action.cpp:385
static bool classof(const Action *A)
Definition Action.h:678
BinaryAnalyzeJobAction(Action *Input, types::ID Type)
Definition Action.cpp:462
BinaryTranslatorJobAction(Action *Input, types::ID Type)
Definition Action.cpp:467
static bool classof(const Action *A)
Definition Action.h:689
static bool classof(const Action *A)
Definition Action.h:266
BindArchAction(Action *Input, BoundArch ArchName)
Definition Action.cpp:191
BoundArch getArch() const
Definition Action.h:264
static bool classof(const Action *A)
Definition Action.h:473
CompileJobAction(Action *Input, types::ID OutputType)
Definition Action.cpp:380
DsymutilJobAction(ActionList &Inputs, types::ID Type)
Definition Action.cpp:410
static bool classof(const Action *A)
Definition Action.h:539
static bool classof(const Action *A)
Definition Action.h:449
ExtractAPIJobAction(Action *Input, types::ID OutputType)
Definition Action.cpp:370
void addHeaderInput(Action *Input)
Definition Action.h:453
static bool classof(const Action *A)
Definition Action.h:506
IfsMergeJobAction(ActionList &Inputs, types::ID Type)
Definition Action.cpp:395
void setId(StringRef _Id)
Definition Action.h:246
InputAction(const llvm::opt::Arg &Input, types::ID Type, StringRef Id=StringRef())
Definition Action.cpp:186
const llvm::opt::Arg & getInputArg() const
Definition Action.h:244
static bool classof(const Action *A)
Definition Action.h:249
StringRef getId() const
Definition Action.h:247
static bool classof(const Action *A)
Definition Action.h:412
JobAction(ActionClass Kind, Action *Input, types::ID Type)
Definition Action.cpp:346
static bool classof(const Action *A)
Definition Action.h:517
LinkJobAction(ActionList &Inputs, types::ID Type)
Definition Action.cpp:400
static bool classof(const Action *A)
Definition Action.h:656
LinkerWrapperJobAction(ActionList &Inputs, types::ID Type)
Definition Action.cpp:451
static bool classof(const Action *A)
Definition Action.h:528
LipoJobAction(ActionList &Inputs, types::ID Type)
Definition Action.cpp:405
static bool classof(const Action *A)
Definition Action.h:700
ObjcopyJobAction(Action *Input, types::ID Type)
Definition Action.cpp:473
Type used to communicate device actions.
Definition Action.h:280
SmallVector< const ToolChain *, 3 > ToolChainList
Definition Action.h:282
SmallVector< BoundArch, 3 > BoundArchList
Definition Action.h:283
const BoundArchList & getBoundArchs() const
Definition Action.h:317
const OffloadKindList & getOffloadKinds() const
Definition Action.h:318
const ActionList & getActions() const
Get each of the individual arrays.
Definition Action.h:315
SmallVector< OffloadKind, 3 > OffloadKindList
Definition Action.h:284
void add(Action &A, const ToolChain &TC, BoundArch BA, OffloadKind OKind)
Add an action along with the associated toolchain, bound arch, and offload kind.
Definition Action.cpp:315
const ToolChainList & getToolChains() const
Definition Action.h:316
Type used to communicate host actions.
Definition Action.h:325
HostDependence(Action &A, const ToolChain &TC, BoundArch BA, const unsigned OffloadKinds)
Definition Action.h:339
const ToolChain * getToolChain() const
Definition Action.h:349
void doOnEachDependence(const OffloadActionWorkTy &Work) const
Execute the work specified in Work on each dependence.
Definition Action.cpp:278
Action * getSingleDeviceDependence(bool DoNotConsiderHostActions=false) const
Return the single device dependence of this action.
Definition Action.cpp:307
bool hasSingleDeviceDependence(bool DoNotConsiderHostActions=false) const
Return true if the action has a single device dependence.
Definition Action.cpp:299
Action * getHostDependence() const
Return the host dependence of this action.
Definition Action.cpp:293
void doOnEachDeviceDependence(const OffloadActionWorkTy &Work) const
Execute the work specified in Work on each device dependence.
Definition Action.cpp:256
bool hasHostDependence() const
Return true if the action has a host dependence.
Definition Action.cpp:291
static bool classof(const Action *A)
Definition Action.h:401
llvm::function_ref< void(Action *, const ToolChain *, BoundArch)> OffloadActionWorkTy
Definition Action.h:354
void doOnHostDependence(const OffloadActionWorkTy &Work) const
Execute the work specified in Work on the host dependence.
Definition Action.cpp:248
OffloadAction(const HostDependence &HDep)
Definition Action.cpp:196
static bool classof(const Action *A)
Definition Action.h:585
OffloadBundlingJobAction(ActionList &Inputs)
Definition Action.cpp:435
OffloadPackagerJobAction(ActionList &Inputs, types::ID Type)
Definition Action.cpp:445
static bool classof(const Action *A)
Definition Action.h:645
static bool classof(const Action *A)
Definition Action.h:634
void registerDependentActionInfo(const ToolChain *TC, BoundArch BA, OffloadKind Kind)
Register information about a dependent action.
Definition Action.h:624
ArrayRef< DependentActionInfo > getDependentActionsInfo() const
Return the information about all depending actions.
Definition Action.h:630
static bool classof(const Action *A)
Definition Action.h:438
PrecompileJobAction(ActionClass Kind, Action *Input, types::ID OutputType)
Definition Action.cpp:362
static bool classof(const Action *A)
Definition Action.h:424
PreprocessJobAction(Action *Input, types::ID OutputType)
Definition Action.cpp:354
StaticLibJobAction(ActionList &Inputs, types::ID Type)
Definition Action.cpp:457
static bool classof(const Action *A)
Definition Action.h:667
ToolChain - Access to tools for a single platform.
Definition ToolChain.h:96
VerifyDebugInfoJobAction(Action *Input, types::ID Type)
Definition Action.cpp:424
static bool classof(const Action *A)
Definition Action.h:562
VerifyJobAction(ActionClass Kind, Action *Input, types::ID Type)
Definition Action.cpp:415
static bool classof(const Action *A)
Definition Action.h:550
static bool classof(const Action *A)
Definition Action.h:573
VerifyPCHJobAction(Action *Input, types::ID Type)
Definition Action.cpp:430
SmallVector< Action *, 3 > ActionList
ActionList - Type used for lists of actions.
Definition Util.h:25
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
Definition Dominators.h:30
Represents a bound architecture for offload / multiple architecture compilation.
const OffloadKind DependentOffloadKind
The offload kind of the dependent action.
Definition Action.h:604
BoundArch DependentBoundArch
The bound architecture of the dependent action.
Definition Action.h:601
DependentActionInfo(const ToolChain *DependentToolChain, BoundArch DependentBoundArch, const OffloadKind DependentOffloadKind)
Definition Action.h:606
const ToolChain * DependentToolChain
The tool chain of the dependent action.
Definition Action.h:598