class Action

Declaration

class Action { /* full declaration omitted */ };

Description

Action - Represent an abstract compilation step to perform. An action represents an edge in the compilation graph; typically it is a job to transform an input using some tool. The current driver is hard wired to expect actions which produce a single primary output, at least in terms of controlling the compilation. Actions can produce auxiliary files, but can only produce a single output to feed into subsequent actions. Actions are usually owned by a Compilation, which creates new actions via MakeAction().

Declared at: clang/include/clang/Driver/Action.h:47

Member Variables

private clang::driver::Action::ActionClass Kind
private types::ID Type
The output type of this action.
private clang::driver::ActionList Inputs
private bool CanBeCollapsedWithNextDependentAction = true
Flag that is set to true if this action can be collapsed with others actions that depend on it. This is true by default and set to false when the action is used by two different tool chains, which is enabled by the offloading support implementation.
protected unsigned int ActiveOffloadKindMask = 0U
The host offloading kind - a combination of kinds encoded in a mask. Multiple programming models may be supported simultaneously by the same host.
protected clang::driver::Action::OffloadKind OffloadingDeviceKind = OFK_None
Offloading kind of the device.
protected const char* OffloadingArch = nullptr
The Offloading architecture associated with this action.
protected const clang::driver::ToolChain* OffloadingToolChain = nullptr
The Offloading toolchain associated with this device action.

Method Overview

Methods

Action(clang::driver::Action::ActionClass Kind,
       types::ID Type)

Declared at: clang/include/clang/Driver/Action.h:135

Parameters

clang::driver::Action::ActionClass Kind
types::ID Type

Action(clang::driver::Action::ActionClass Kind,
       clang::driver::Action* Input,
       types::ID Type)

Declared at: clang/include/clang/Driver/Action.h:136

Parameters

clang::driver::Action::ActionClass Kind
clang::driver::Action* Input
types::ID Type

Action(clang::driver::Action::ActionClass Kind,
       clang::driver::Action* Input)

Declared at: clang/include/clang/Driver/Action.h:138

Parameters

clang::driver::Action::ActionClass Kind
clang::driver::Action* Input

Action(clang::driver::Action::ActionClass Kind,
       const clang::driver::ActionList& Inputs,
       types::ID Type)

Declared at: clang/include/clang/Driver/Action.h:140

Parameters

clang::driver::Action::ActionClass Kind
const clang::driver::ActionList& Inputs
types::ID Type

static llvm::StringRef GetOffloadKindName(
    clang::driver::Action::OffloadKind Kind)

Description

Return a string containing a offload kind name.

Declared at: clang/include/clang/Driver/Action.h:187

Parameters

clang::driver::Action::OffloadKind Kind

static std::string GetOffloadingFileNamePrefix(
    clang::driver::Action::OffloadKind Kind,
    llvm::StringRef NormalizedTriple,
    bool CreatePrefixForHost = false)

Description

Return a string that can be used as prefix in order to generate unique files for each offloading kind. By default, no prefix is used for non-device kinds, except if \a CreatePrefixForHost is set.

Declared at: clang/include/clang/Driver/Action.h:182

Parameters

clang::driver::Action::OffloadKind Kind
llvm::StringRef NormalizedTriple
bool CreatePrefixForHost = false

const char* getClassName() const

Declared at: clang/include/clang/Driver/Action.h:146

static const char* getClassName(
    clang::driver::Action::ActionClass AC)

Declared at: clang/include/clang/Driver/Action.h:100

Parameters

clang::driver::Action::ActionClass AC

clang::driver::ActionList& getInputs()

Declared at: clang/include/clang/Driver/Action.h:151

const clang::driver::ActionList& getInputs() const

Declared at: clang/include/clang/Driver/Action.h:152

clang::driver::Action::ActionClass getKind() const

Declared at: clang/include/clang/Driver/Action.h:148

const char* getOffloadingArch() const

Declared at: clang/include/clang/Driver/Action.h:212

clang::driver::Action::OffloadKind
getOffloadingDeviceKind() const

Declared at: clang/include/clang/Driver/Action.h:211

unsigned int getOffloadingHostActiveKinds() const

Declared at: clang/include/clang/Driver/Action.h:207

std::string getOffloadingKindPrefix() const

Description

Return a string containing the offload kind of the action.

Declared at: clang/include/clang/Driver/Action.h:176

const clang::driver::ToolChain*
getOffloadingToolChain() const

Declared at: clang/include/clang/Driver/Action.h:213

types::ID getType() const

Declared at: clang/include/clang/Driver/Action.h:149

clang::driver::Action::input_iterator
input_begin()

Declared at: clang/include/clang/Driver/Action.h:156

clang::driver::Action::input_const_iterator
input_begin() const

Declared at: clang/include/clang/Driver/Action.h:159

clang::driver::Action::input_iterator input_end()

Declared at: clang/include/clang/Driver/Action.h:157

clang::driver::Action::input_const_iterator
input_end() const

Declared at: clang/include/clang/Driver/Action.h:160

clang::driver::Action::input_const_range inputs()
    const

Declared at: clang/include/clang/Driver/Action.h:161

clang::driver::Action::input_range inputs()

Declared at: clang/include/clang/Driver/Action.h:158

bool isCollapsingWithNextDependentActionLegal()
    const

Description

Return true if this function can be collapsed with others.

Declared at: clang/include/clang/Driver/Action.h:171

bool isDeviceOffloading(
    clang::driver::Action::OffloadKind OKind)
    const

Declared at: clang/include/clang/Driver/Action.h:222

Parameters

clang::driver::Action::OffloadKind OKind

bool isHostOffloading(unsigned int OKind) const

Description

Check if this action have any offload kinds. Note that host offload kinds are only set if the action is a dependence to a host offload action.

Declared at: clang/include/clang/Driver/Action.h:219

Parameters

unsigned int OKind

bool isOffloading(
    clang::driver::Action::OffloadKind OKind)
    const

Declared at: clang/include/clang/Driver/Action.h:225

Parameters

clang::driver::Action::OffloadKind OKind

void propagateDeviceOffloadInfo(
    clang::driver::Action::OffloadKind OKind,
    const char* OArch,
    const clang::driver::ToolChain* OToolChain)

Description

Set the device offload info of this action and propagate it to its dependences.

Declared at: clang/include/clang/Driver/Action.h:191

Parameters

clang::driver::Action::OffloadKind OKind
const char* OArch
const clang::driver::ToolChain* OToolChain

void propagateHostOffloadInfo(unsigned int OKinds,
                              const char* OArch)

Description

Append the host offload info of this action and propagate it to its dependences.

Declared at: clang/include/clang/Driver/Action.h:196

Parameters

unsigned int OKinds
const char* OArch

void propagateOffloadInfo(
    const clang::driver::Action* A)

Description

Set the offload info of this action to be the same as the provided action, and propagate it to its dependences.

Declared at: clang/include/clang/Driver/Action.h:205

Parameters

const clang::driver::Action* A

void setCannotBeCollapsedWithNextDependentAction()

Description

Mark this action as not legal to collapse.

Declared at: clang/include/clang/Driver/Action.h:166

void setHostOffloadInfo(unsigned int OKinds,
                        const char* OArch)

Declared at: clang/include/clang/Driver/Action.h:198

Parameters

unsigned int OKinds
const char* OArch

clang::driver::Action::size_type size() const

Declared at: clang/include/clang/Driver/Action.h:154

virtual ~Action()

Declared at: clang/include/clang/Driver/Action.h:144