diff options
author | Alexey Bader <alexey.bader@intel.com> | 2019-12-10 16:52:58 +0300 |
---|---|---|
committer | Alexey Bader <alexey.bader@intel.com> | 2019-12-11 12:40:43 +0300 |
commit | cb30ad728f0b7666691c72a6a1399f36ebc60ad5 (patch) | |
tree | 7ac41df3c9efcf1131b3a9f3f776c900060dae18 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | f21c081b78ec7a83a79137c65edd58874b262761 (diff) | |
download | bcm5719-llvm-cb30ad728f0b7666691c72a6a1399f36ebc60ad5.tar.gz bcm5719-llvm-cb30ad728f0b7666691c72a6a1399f36ebc60ad5.zip |
[SYCL] Add support for auxiliary triple specification to Frontend
Summary:
Add host predefined macros to compilation for SYCL device, which is
required for pre-processing host specific includes (e.g. system
headers).
Reviewers: ABataev, jdoerfert
Subscribers: ebevhan, Anastasia, cfe-commits, keryell, Naghasan, Fznamznon
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71286
Signed-off-by: Alexey Bader <alexey.bader@intel.com>
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index b69dc4f854f..05ecc3f447c 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -917,8 +917,9 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { if (!hasTarget()) return false; - // Create TargetInfo for the other side of CUDA and OpenMP compilation. - if ((getLangOpts().CUDA || getLangOpts().OpenMPIsDevice) && + // Create TargetInfo for the other side of CUDA/OpenMP/SYCL compilation. + if ((getLangOpts().CUDA || getLangOpts().OpenMPIsDevice || + getLangOpts().SYCLIsDevice) && !getFrontendOpts().AuxTriple.empty()) { auto TO = std::make_shared<TargetOptions>(); TO->Triple = llvm::Triple::normalize(getFrontendOpts().AuxTriple); |