aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Driver/Action.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-01-18 16:23:48 +0000
commit06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch)
tree3eb853da77d46cc77c4b017525a422f9ddb1385b /include/clang/Driver/Action.h
parent30d791273d07fac9c0c1641a0731191bca6e8606 (diff)
downloadsrc-06d4ba388873e6d1cfa9cd715a8935ecc8cd2097.tar.gz
src-06d4ba388873e6d1cfa9cd715a8935ecc8cd2097.zip
Notes
Diffstat (limited to 'include/clang/Driver/Action.h')
-rw-r--r--include/clang/Driver/Action.h46
1 files changed, 31 insertions, 15 deletions
diff --git a/include/clang/Driver/Action.h b/include/clang/Driver/Action.h
index 2cdb581b85c3..dd0261c2f3a1 100644
--- a/include/clang/Driver/Action.h
+++ b/include/clang/Driver/Action.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef CLANG_DRIVER_ACTION_H_
-#define CLANG_DRIVER_ACTION_H_
+#ifndef LLVM_CLANG_DRIVER_ACTION_H
+#define LLVM_CLANG_DRIVER_ACTION_H
#include "clang/Driver/Types.h"
#include "clang/Driver/Util.h"
@@ -46,6 +46,7 @@ public:
AnalyzeJobClass,
MigrateJobClass,
CompileJobClass,
+ BackendJobClass,
AssembleJobClass,
LinkJobClass,
LipoJobClass,
@@ -72,8 +73,12 @@ private:
protected:
Action(ActionClass _Kind, types::ID _Type)
: Kind(_Kind), Type(_Type), OwnsInputs(true) {}
- Action(ActionClass _Kind, Action *Input, types::ID _Type)
- : Kind(_Kind), Type(_Type), Inputs(&Input, &Input + 1), 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()),
+ OwnsInputs(true) {}
Action(ActionClass _Kind, const ActionList &_Inputs, types::ID _Type)
: Kind(_Kind), Type(_Type), Inputs(_Inputs), OwnsInputs(true) {}
public:
@@ -119,7 +124,7 @@ class BindArchAction : public Action {
const char *ArchName;
public:
- BindArchAction(Action *Input, const char *_ArchName);
+ BindArchAction(std::unique_ptr<Action> Input, const char *_ArchName);
const char *getArchName() const { return ArchName; }
@@ -131,7 +136,7 @@ public:
class JobAction : public Action {
virtual void anchor();
protected:
- JobAction(ActionClass Kind, Action *Input, types::ID Type);
+ JobAction(ActionClass Kind, std::unique_ptr<Action> Input, types::ID Type);
JobAction(ActionClass Kind, const ActionList &Inputs, types::ID Type);
public:
@@ -144,7 +149,7 @@ public:
class PreprocessJobAction : public JobAction {
void anchor() override;
public:
- PreprocessJobAction(Action *Input, types::ID OutputType);
+ PreprocessJobAction(std::unique_ptr<Action> Input, types::ID OutputType);
static bool classof(const Action *A) {
return A->getKind() == PreprocessJobClass;
@@ -154,7 +159,7 @@ public:
class PrecompileJobAction : public JobAction {
void anchor() override;
public:
- PrecompileJobAction(Action *Input, types::ID OutputType);
+ PrecompileJobAction(std::unique_ptr<Action> Input, types::ID OutputType);
static bool classof(const Action *A) {
return A->getKind() == PrecompileJobClass;
@@ -164,7 +169,7 @@ public:
class AnalyzeJobAction : public JobAction {
void anchor() override;
public:
- AnalyzeJobAction(Action *Input, types::ID OutputType);
+ AnalyzeJobAction(std::unique_ptr<Action> Input, types::ID OutputType);
static bool classof(const Action *A) {
return A->getKind() == AnalyzeJobClass;
@@ -174,7 +179,7 @@ public:
class MigrateJobAction : public JobAction {
void anchor() override;
public:
- MigrateJobAction(Action *Input, types::ID OutputType);
+ MigrateJobAction(std::unique_ptr<Action> Input, types::ID OutputType);
static bool classof(const Action *A) {
return A->getKind() == MigrateJobClass;
@@ -184,17 +189,27 @@ public:
class CompileJobAction : public JobAction {
void anchor() override;
public:
- CompileJobAction(Action *Input, types::ID OutputType);
+ CompileJobAction(std::unique_ptr<Action> Input, types::ID OutputType);
static bool classof(const Action *A) {
return A->getKind() == CompileJobClass;
}
};
+class BackendJobAction : public JobAction {
+ void anchor() override;
+public:
+ BackendJobAction(std::unique_ptr<Action> Input, types::ID OutputType);
+
+ static bool classof(const Action *A) {
+ return A->getKind() == BackendJobClass;
+ }
+};
+
class AssembleJobAction : public JobAction {
void anchor() override;
public:
- AssembleJobAction(Action *Input, types::ID OutputType);
+ AssembleJobAction(std::unique_ptr<Action> Input, types::ID OutputType);
static bool classof(const Action *A) {
return A->getKind() == AssembleJobClass;
@@ -234,7 +249,8 @@ public:
class VerifyJobAction : public JobAction {
void anchor() override;
public:
- VerifyJobAction(ActionClass Kind, Action *Input, types::ID Type);
+ VerifyJobAction(ActionClass Kind, std::unique_ptr<Action> Input,
+ types::ID Type);
VerifyJobAction(ActionClass Kind, ActionList &Inputs, types::ID Type);
static bool classof(const Action *A) {
return A->getKind() == VerifyDebugInfoJobClass ||
@@ -245,7 +261,7 @@ public:
class VerifyDebugInfoJobAction : public VerifyJobAction {
void anchor() override;
public:
- VerifyDebugInfoJobAction(Action *Input, types::ID Type);
+ VerifyDebugInfoJobAction(std::unique_ptr<Action> Input, types::ID Type);
static bool classof(const Action *A) {
return A->getKind() == VerifyDebugInfoJobClass;
}
@@ -254,7 +270,7 @@ public:
class VerifyPCHJobAction : public VerifyJobAction {
void anchor() override;
public:
- VerifyPCHJobAction(Action *Input, types::ID Type);
+ VerifyPCHJobAction(std::unique_ptr<Action> Input, types::ID Type);
static bool classof(const Action *A) {
return A->getKind() == VerifyPCHJobClass;
}