summaryrefslogtreecommitdiff
path: root/lib/Driver/Action.cpp
diff options
context:
space:
mode:
authorSamuel Antao <sfantao@us.ibm.com>2016-10-27 18:04:42 +0000
committerSamuel Antao <sfantao@us.ibm.com>2016-10-27 18:04:42 +0000
commite9c115b33b48afa24a5e3700cdf27460d1c77262 (patch)
treef4b71a6d8de80307a2b8bb459d378639d17b372b /lib/Driver/Action.cpp
parentf03a8c88a8a1228be877f524af78433f23bd408b (diff)
downloadclang-e9c115b33b48afa24a5e3700cdf27460d1c77262.tar.gz
[Driver][OpenMP] Add support to create jobs for bundling actions.
Summary: This patch adds the support to create a job for the `OffloadBundlingAction` which will invoke the `clang-offload-bundler` tool. 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/D21856 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285325 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Action.cpp')
-rw-r--r--lib/Driver/Action.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Driver/Action.cpp b/lib/Driver/Action.cpp
index 79e3da37ba..ad6fb71810 100644
--- a/lib/Driver/Action.cpp
+++ b/lib/Driver/Action.cpp
@@ -9,6 +9,7 @@
#include "clang/Driver/Action.h"
#include "clang/Driver/ToolChain.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Regex.h"
@@ -128,6 +129,22 @@ Action::getOffloadingFileNamePrefix(llvm::StringRef NormalizedTriple) const {
return Res;
}
+/// Return a string with the offload kind name. If that is not defined, we
+/// assume 'host'.
+llvm::StringRef Action::GetOffloadKindName(OffloadKind Kind) {
+ switch (Kind) {
+ case OFK_None:
+ case OFK_Host:
+ return "host";
+ case OFK_Cuda:
+ return "cuda";
+ case OFK_OpenMP:
+ return "openmp";
+
+ // TODO: Add other programming models here.
+ }
+}
+
void InputAction::anchor() {}
InputAction::InputAction(const Arg &_Input, types::ID _Type)