diff options
Diffstat (limited to 'include/clang/Driver/Action.h')
-rw-r--r-- | include/clang/Driver/Action.h | 57 |
1 files changed, 47 insertions, 10 deletions
diff --git a/include/clang/Driver/Action.h b/include/clang/Driver/Action.h index dd0261c..fddd158 100644 --- a/include/clang/Driver/Action.h +++ b/include/clang/Driver/Action.h @@ -41,6 +41,8 @@ public: enum ActionClass { InputClass = 0, BindArchClass, + CudaDeviceClass, + CudaHostClass, PreprocessJobClass, PrecompileJobClass, AnalyzeJobClass, @@ -71,16 +73,16 @@ private: unsigned OwnsInputs : 1; protected: - Action(ActionClass _Kind, types::ID _Type) - : Kind(_Kind), Type(_Type), OwnsInputs(true) {} - Action(ActionClass _Kind, std::unique_ptr<Action> Input, types::ID _Type) - : Kind(_Kind), Type(_Type), Inputs(1, Input.release()), OwnsInputs(true) { + Action(ActionClass Kind, types::ID Type) + : Kind(Kind), Type(Type), OwnsInputs(true) {} + Action(ActionClass Kind, std::unique_ptr<Action> Input, types::ID Type) + : Kind(Kind), Type(Type), Inputs(1, Input.release()), OwnsInputs(true) { } - Action(ActionClass _Kind, std::unique_ptr<Action> Input) - : Kind(_Kind), Type(Input->getType()), Inputs(1, Input.release()), + Action(ActionClass Kind, std::unique_ptr<Action> Input) + : Kind(Kind), Type(Input->getType()), Inputs(1, Input.release()), OwnsInputs(true) {} - Action(ActionClass _Kind, const ActionList &_Inputs, types::ID _Type) - : Kind(_Kind), Type(_Type), Inputs(_Inputs), OwnsInputs(true) {} + Action(ActionClass Kind, const ActionList &Inputs, types::ID Type) + : Kind(Kind), Type(Type), Inputs(Inputs), OwnsInputs(true) {} public: virtual ~Action(); @@ -108,7 +110,7 @@ class InputAction : public Action { const llvm::opt::Arg &Input; public: - InputAction(const llvm::opt::Arg &_Input, types::ID _Type); + InputAction(const llvm::opt::Arg &Input, types::ID Type); const llvm::opt::Arg &getInputArg() const { return Input; } @@ -124,7 +126,7 @@ class BindArchAction : public Action { const char *ArchName; public: - BindArchAction(std::unique_ptr<Action> Input, const char *_ArchName); + BindArchAction(std::unique_ptr<Action> Input, const char *ArchName); const char *getArchName() const { return ArchName; } @@ -133,6 +135,41 @@ public: } }; +class CudaDeviceAction : public Action { + virtual void anchor(); + /// GPU architecture to bind -- e.g 'sm_35'. + const char *GpuArchName; + /// True when action results are not consumed by the host action (e.g when + /// -fsyntax-only or --cuda-device-only options are used). + bool AtTopLevel; + +public: + CudaDeviceAction(std::unique_ptr<Action> Input, const char *ArchName, + bool AtTopLevel); + + const char *getGpuArchName() const { return GpuArchName; } + bool isAtTopLevel() const { return AtTopLevel; } + + static bool classof(const Action *A) { + return A->getKind() == CudaDeviceClass; + } +}; + +class CudaHostAction : public Action { + virtual void anchor(); + ActionList DeviceActions; + +public: + CudaHostAction(std::unique_ptr<Action> Input, + const ActionList &DeviceActions); + ~CudaHostAction() override; + + ActionList &getDeviceActions() { return DeviceActions; } + const ActionList &getDeviceActions() const { return DeviceActions; } + + static bool classof(const Action *A) { return A->getKind() == CudaHostClass; } +}; + class JobAction : public Action { virtual void anchor(); protected: |