[SYCL] Driver option to select SYCL version
authorRuyman <ruyman@codeplay.com>
Fri, 26 Jul 2019 15:21:01 +0000 (16:21 +0100)
committerAlexey Bader <alexey.bader@intel.com>
Thu, 27 Feb 2020 12:08:42 +0000 (15:08 +0300)
commitbd97704eaaaab5a95ecb048ce343c1a4be5d94e5
treeef53dec91525f29ea71e0f15f6119ab43cfa537c
parentee1b2e7ded12ef6e11ce35bb9929490ac9e7fa4f
[SYCL] Driver option to select SYCL version

Summary:
User can select the version of SYCL the compiler will
use via the flag -sycl-std, similar to -cl-std.

The flag defines the LangOpts.SYCLVersion option to the
version of SYCL. The default value is undefined.
If driver is building SYCL code, flag is set to the default SYCL
version (1.2.1)

The preprocessor uses this variable to define CL_SYCL_LANGUAGE_VERSION macro,
which should be defined according to SYCL 1.2.1 standard.

Only valid value at this point for the flag is 1.2.1.

Co-Authored-By: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
Signed-off-by: Ruyman Reyes <ruyman@codeplay.com>
Subscribers: ebevhan, Anastasia, cfe-commits

Tags: #clang

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

Signed-off-by: Alexey Bader <alexey.bader@intel.com>
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/InitPreprocessor.cpp
clang/test/Driver/sycl.c
clang/test/Frontend/sycl-aux-triple.cpp
clang/test/Preprocessor/sycl-macro.cpp
clang/test/SemaSYCL/kernel-attribute.cpp