summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorAlexey Bader <alexey.bader@intel.com>2019-02-25 11:48:48 +0000
committerAlexey Bader <alexey.bader@intel.com>2019-02-25 11:48:48 +0000
commit3f62fa69a7200821969c0a026bdbdfa268f8bb75 (patch)
tree7bac1159fba0a14208859e14de814558d5678d54 /clang/lib/Frontend/InitPreprocessor.cpp
parent478cd32bcb7accbbe956597252700e3ba2e25457 (diff)
downloadbcm5719-llvm-3f62fa69a7200821969c0a026bdbdfa268f8bb75.tar.gz
bcm5719-llvm-3f62fa69a7200821969c0a026bdbdfa268f8bb75.zip
[SYCL] Add clang front-end option to enable SYCL device compilation flow.
Patch by Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> llvm-svn: 354773
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index c9f9f644f37..b0fb124251e 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -1057,6 +1057,12 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("__CLANG_CUDA_APPROX_TRANSCENDENTALS__");
}
+ // Define a macro indicating that the source file is being compiled with a
+ // SYCL device compiler which doesn't produce host binary.
+ if (LangOpts.SYCLIsDevice) {
+ Builder.defineMacro("__SYCL_DEVICE_ONLY__", "1");
+ }
+
// OpenCL definitions.
if (LangOpts.OpenCL) {
#define OPENCLEXT(Ext) \
OpenPOWER on IntegriCloud