[CUDA][OpenMP] Add a generic offload action builder
authorSamuel Antao <sfantao@us.ibm.com>
Fri, 30 Sep 2016 15:34:19 +0000 (15:34 +0000)
committerSamuel Antao <sfantao@us.ibm.com>
Fri, 30 Sep 2016 15:34:19 +0000 (15:34 +0000)
commit64e965e4ee747f5ba27d17f06cfafd5abc7fddb9
treea1b2bfad49f84097a1f621f74b51af5946d579c4
parent32312d0294c57a181ed7ba08431a644f11e1be6d
[CUDA][OpenMP] Add a generic offload action builder

Summary:
This patch proposes a new class to generate and record action dependences related with offloading. The builder provides three main functionalities:
- Add device dependences to host actions.
- Add host dependence to device actions.
- Register device top-level actions.

The constructor of the builder detect the programming models that should be supported, and generates a specialized builder for each. If a new programming model is to be added in the future, only a new specialized builder has to be implemented.

When the specialized builder is generated, it produces programming-model-specific diagnostics.

A CUDA specialized builder is proposed in the patch that mostly consists of the partition of the current  `buildCudaAction` by the three different functionalities.

Reviewers: tra, echristo, ABataev, jlebar, hfinkel

Subscribers: Hahnfeld, whchung, guansong, jlebar, mehdi_amini, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

Differential Revision: https://reviews.llvm.org/D18172

llvm-svn: 282865
clang/include/clang/Driver/Compilation.h
clang/lib/Driver/Driver.cpp
clang/lib/Driver/Types.cpp
clang/test/Driver/cuda-bindings.cu
clang/test/Driver/cuda-phases.cu