summaryrefslogtreecommitdiffstats
path: root/lib/Driver/Action.cpp
diff options
context:
space:
mode:
authorSamuel Antao <sfantao@us.ibm.com>2016-10-27 18:00:51 +0000
committerSamuel Antao <sfantao@us.ibm.com>2016-10-27 18:00:51 +0000
commitf03a8c88a8a1228be877f524af78433f23bd408b (patch)
treedb4522572467e209ce3481562b6d10243bbff53d /lib/Driver/Action.cpp
parentde524d8e3d494214c3db591ce52f1d80910b8b06 (diff)
[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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Action.cpp')
-rw-r--r--lib/Driver/Action.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Driver/Action.cpp b/lib/Driver/Action.cpp
index 90bc149fd3..79e3da37ba 100644
--- a/lib/Driver/Action.cpp
+++ b/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()) {}