aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Driver/Compilation.cpp
diff options
context:
space:
mode:
authorSamuel Antao <sfantao@us.ibm.com>2016-06-13 18:10:57 +0000
committerSamuel Antao <sfantao@us.ibm.com>2016-06-13 18:10:57 +0000
commitc1ffba5062c7fc8997a49f5656ff6ebc1d9de633 (patch)
tree569d8c1410ded757a651b83e5d27635b1f5c6a21 /clang/lib/Driver/Compilation.cpp
parent8cb45c838f99fd1cbc38bdc5bd272f6d090ce147 (diff)
downloadllvm-c1ffba5062c7fc8997a49f5656ff6ebc1d9de633.zip
llvm-c1ffba5062c7fc8997a49f5656ff6ebc1d9de633.tar.gz
llvm-c1ffba5062c7fc8997a49f5656ff6ebc1d9de633.tar.bz2
[CUDA][OpenMP] Create generic offload toolchains
Summary: This patch introduces the concept of offloading tool chain and offloading kind. Each tool chain may have associated an offloading kind that marks it as used in a given programming model that requires offloading. It also adds the logic to iterate on the tool chains based on the kind. Currently, only CUDA is supported, but in general a programming model (an offloading kind) may have associated multiple tool chains that require supporting offloading. This patch does not add tests - its goal is to keep the existing functionality. This patch is the first of a series of three that attempts to make the current support of CUDA more generic and easier to extend to other programming models, namely OpenMP. It tries to capture the suggestions/improvements/concerns on the initial proposal in http://lists.llvm.org/pipermail/cfe-dev/2016-February/047547.html. It only tackles the more consensual part of the proposal, i.e.does not address the problem of intermediate files bundling yet. Reviewers: ABataev, jlebar, echristo, hfinkel, tra Subscribers: guansong, Hahnfeld, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin Differential Revision: http://reviews.llvm.org/D18170 llvm-svn: 272571
Diffstat (limited to 'clang/lib/Driver/Compilation.cpp')
-rw-r--r--clang/lib/Driver/Compilation.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Driver/Compilation.cpp b/clang/lib/Driver/Compilation.cpp
index b24d381..46548e6 100644
--- a/clang/lib/Driver/Compilation.cpp
+++ b/clang/lib/Driver/Compilation.cpp
@@ -24,10 +24,13 @@ using namespace llvm::opt;
Compilation::Compilation(const Driver &D, const ToolChain &_DefaultToolChain,
InputArgList *_Args, DerivedArgList *_TranslatedArgs)
- : TheDriver(D), DefaultToolChain(_DefaultToolChain),
- CudaHostToolChain(&DefaultToolChain), CudaDeviceToolChain(nullptr),
+ : TheDriver(D), DefaultToolChain(_DefaultToolChain), ActiveOffloadMask(0u),
Args(_Args), TranslatedArgs(_TranslatedArgs), Redirects(nullptr),
- ForDiagnostics(false) {}
+ ForDiagnostics(false) {
+ // The offloading host toolchain is the default tool chain.
+ OrderedOffloadingToolchains.insert(
+ std::make_pair(Action::OFK_Host, &DefaultToolChain));
+}
Compilation::~Compilation() {
delete TranslatedArgs;