diff options
| author | Samuel Antao <sfantao@us.ibm.com> | 2016-10-27 18:00:51 +0000 |
|---|---|---|
| committer | Samuel Antao <sfantao@us.ibm.com> | 2016-10-27 18:00:51 +0000 |
| commit | fab4f37ef7e81dfa25070cf6f5488980a0c687bf (patch) | |
| tree | f43cd013e6b346b3fb2ae5f8a88ae7d514922fd8 /clang/lib/Driver/Action.cpp | |
| parent | 69d6f31f744a8b3dcb1a3fecae41a9d6f667b476 (diff) | |
| download | bcm5719-llvm-fab4f37ef7e81dfa25070cf6f5488980a0c687bf.tar.gz bcm5719-llvm-fab4f37ef7e81dfa25070cf6f5488980a0c687bf.zip | |
[Driver][OpenMP] Update actions builder to create unbundling action when necessary.
Summary:
Each time that offloading support is requested by the user and the input file is not a source file, an action `OffloadUnbundlingAction` is created to signal that the input file may contain bundles, so that the proper tool is then invoked to attempt to extract the components of the bundle. This patch adds the logic to create that action in offload action builder.
The job creation for the new action will be proposed in a separate patch.
Reviewers: echristo, tra, jlebar, ABataev, hfinkel
Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin
Differential Revision: https://reviews.llvm.org/D21853
llvm-svn: 285324
Diffstat (limited to 'clang/lib/Driver/Action.cpp')
| -rw-r--r-- | clang/lib/Driver/Action.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Driver/Action.cpp b/clang/lib/Driver/Action.cpp index 90bc149fd33..79e3da37baf 100644 --- a/clang/lib/Driver/Action.cpp +++ b/clang/lib/Driver/Action.cpp @@ -38,6 +38,8 @@ const char *Action::getClassName(ActionClass AC) { case VerifyPCHJobClass: return "verify-pch"; case OffloadBundlingJobClass: return "clang-offload-bundler"; + case OffloadUnbundlingJobClass: + return "clang-offload-unbundler"; } llvm_unreachable("invalid class"); @@ -47,6 +49,9 @@ void Action::propagateDeviceOffloadInfo(OffloadKind OKind, const char *OArch) { // Offload action set its own kinds on their dependences. if (Kind == OffloadClass) return; + // Unbundling actions use the host kinds. + if (Kind == OffloadUnbundlingJobClass) + return; assert((OffloadingDeviceKind == OKind || OffloadingDeviceKind == OFK_None) && "Setting device kind to a different device??"); @@ -353,3 +358,8 @@ void OffloadBundlingJobAction::anchor() {} OffloadBundlingJobAction::OffloadBundlingJobAction(ActionList &Inputs) : JobAction(OffloadBundlingJobClass, Inputs, Inputs.front()->getType()) {} + +void OffloadUnbundlingJobAction::anchor() {} + +OffloadUnbundlingJobAction::OffloadUnbundlingJobAction(Action *Input) + : JobAction(OffloadUnbundlingJobClass, Input, Input->getType()) {} |

