10 #ifndef LLVM_CLANG_DRIVER_ACTION_H
11 #define LLVM_CLANG_DRIVER_ACTION_H
16 #include "llvm/ADT/STLExtras.h"
17 #include "llvm/ADT/SmallVector.h"
115 : Kind(Kind), Type(Type), Inputs(Inputs) {}
176 virtual void anchor();
177 const llvm::opt::Arg &Input;
190 virtual void anchor();
193 const char *ArchName;
209 virtual void anchor();
246 return DeviceOffloadKinds;
258 const char *HostBoundArch =
nullptr;
260 unsigned HostOffloadKinds = 0u;
264 const unsigned OffloadKinds)
265 : HostAction(A), HostToolChain(TC), HostBoundArch(BoundArch),
266 HostOffloadKinds(OffloadKinds){};
277 typedef llvm::function_ref<void(Action *, const ToolChain *, const char *)>
328 virtual void anchor();
341 void anchor()
override;
351 void anchor()
override;
361 void anchor()
override;
371 void anchor()
override;
381 void anchor()
override;
391 void anchor()
override;
401 void anchor()
override;
411 void anchor()
override;
421 void anchor()
override;
431 void anchor()
override;
441 void anchor()
override;
451 void anchor()
override;
460 void anchor()
override;
const ActionList & getActions() const
Get each of the individual arrays.
AssembleJobAction(Action *Input, types::ID OutputType)
OffloadAction(const HostDependence &HDep)
PrecompileJobAction(Action *Input, types::ID OutputType)
BackendJobAction(Action *Input, types::ID OutputType)
static bool classof(const Action *A)
Action(ActionClass Kind, Action *Input, types::ID Type)
const char * getBoundArch() const
llvm::iterator_range< input_iterator > input_range
MigrateJobAction(Action *Input, types::ID OutputType)
bool hasSingleDeviceDependence(bool DoNotConsiderHostActions=false) const
Return true if the action has a single device dependence.
The base class of the type hierarchy.
static bool classof(const Action *A)
unsigned getOffloadKinds() const
LinkJobAction(ActionList &Inputs, types::ID Type)
Action(ActionClass Kind, types::ID Type)
Type used to communicate device actions.
llvm::function_ref< void(Action *, const ToolChain *, const char *)> OffloadActionWorkTy
types::ID getType() const
VerifyJobAction(ActionClass Kind, Action *Input, types::ID Type)
VerifyDebugInfoJobAction(Action *Input, types::ID Type)
input_const_iterator input_begin() const
CompileJobAction(Action *Input, types::ID OutputType)
JobAction(ActionClass Kind, Action *Input, types::ID Type)
Action * getAction() const
OffloadKind OffloadingDeviceKind
Offloading kind of the device.
OffloadKind getOffloadingDeviceKind() const
LipoJobAction(ActionList &Inputs, types::ID Type)
static bool classof(const Action *A)
Type used to communicate host actions.
ActionClass getKind() const
unsigned getOffloadingHostActiveKinds() const
Action - Represent an abstract compilation step to perform.
static bool classof(const Action *A)
std::string getOffloadingKindPrefix() const
Return a string containing the offload kind of the action.
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...
void doOnHostDependence(const OffloadActionWorkTy &Work) const
Execute the work specified in Work on the host dependence.
static bool classof(const Action *A)
ActionList::size_type size_type
DsymutilJobAction(ActionList &Inputs, types::ID Type)
PreprocessJobAction(Action *Input, types::ID OutputType)
static bool classof(const Action *A)
input_iterator input_begin()
SmallVector< const char *, 3 > BoundArchList
input_iterator input_end()
void propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch)
Set the device offload info of this action and propagate it to its dependences.
void add(Action &A, const ToolChain &TC, const char *BoundArch, OffloadKind OKind)
Add a action along with the associated toolchain, bound arch, and offload kind.
SmallVector< const ToolChain *, 3 > ToolChainList
static bool classof(const Action *A)
unsigned ActiveOffloadKindMask
Offload information.
void doOnEachDeviceDependence(const OffloadActionWorkTy &Work) const
Execute the work specified in Work on each device dependence.
const OffloadKindList & getOffloadKinds() const
static bool classof(const Action *A)
VerifyPCHJobAction(Action *Input, types::ID Type)
const char * getOffloadingArch() const
static bool classof(const Action *A)
bool isHostOffloading(OffloadKind OKind) const
Check if this action have any offload kinds.
static bool classof(const Action *A)
const ActionList & getInputs() const
HostDependence(Action &A, const ToolChain &TC, const char *BoundArch, const unsigned OffloadKinds)
const char * OffloadingArch
The Offloading architecture associated with this action.
const ToolChain * getToolChain() const
void doOnEachDependence(const OffloadActionWorkTy &Work) const
Execute the work specified in Work on each dependence.
const TemplateArgument * iterator
static bool classof(const Action *A)
const ToolChainList & getToolChains() const
AnalyzeJobAction(Action *Input, types::ID OutputType)
An offload action combines host or/and device actions according to the programming model implementati...
const char * getArchName() const
SmallVector< Action *, 3 > ActionList
ActionList - Type used for lists of actions.
Action * getHostDependence() const
Return the host dependence of this action.
static bool classof(const Action *A)
input_const_range inputs() const
const char * getClassName() const
BindArchAction(Action *Input, const char *ArchName)
const BoundArchList & getBoundArchs() const
bool isOffloading(OffloadKind OKind) const
llvm::iterator_range< input_const_iterator > input_const_range
SmallVector< OffloadKind, 3 > OffloadKindList
Action * getSingleDeviceDependence(bool DoNotConsiderHostActions=false) const
Return the single device dependence of this action.
std::string getOffloadingFileNamePrefix(llvm::StringRef NormalizedTriple) const
Return a string that can be used as prefix in order to generate unique files for each offloading kind...
ActionList::const_iterator input_const_iterator
bool hasHostDependence() const
Return true if the action has a host dependence.
ActionList::iterator input_iterator
bool isDeviceOffloading(OffloadKind OKind) const
void propagateHostOffloadInfo(unsigned OKinds, const char *OArch)
Append the host offload info of this action and propagate it to its dependences.
static bool classof(const Action *A)
input_const_iterator input_end() const
static bool classof(const Action *A)
static bool classof(const Action *A)
static bool classof(const Action *A)