[OpenCL] Add support of __opencl_c_pipes feature macro.
authorAnton Zabaznov <anton.zabaznov@intel.com>
Fri, 30 Jul 2021 11:08:59 +0000 (14:08 +0300)
committerAnton Zabaznov <anton.zabaznov@intel.com>
Fri, 30 Jul 2021 15:10:25 +0000 (18:10 +0300)
commitacc58504952f0e2ca48a44d868f684e3b135dd34
treec49cd7efc0cb3833fa8c4a593925d714b2a876ef
parenta7a39ec886a03cbf70ef187c49370f63514ae931
[OpenCL] Add support of __opencl_c_pipes feature macro.

'pipe' keyword is introduced in OpenCL C 2.0: so do checks for OpenCL C version while
parsing and then later on check for language options to construct actual pipe. This feature
requires support of __opencl_c_generic_address_space, so diagnostics for that is provided as well.

This is the same patch as in D106748 but with a tiny fix in checking of diagnostic messages.
Also added tests when program scope global variables are not supported.

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D107154
15 files changed:
clang/include/clang/Basic/LangOptions.def
clang/lib/Basic/OpenCLOptions.cpp
clang/lib/Basic/TargetInfo.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Parse/ParseDecl.cpp
clang/lib/Sema/Sema.cpp
clang/test/CodeGenOpenCL/address-spaces-mangling.cl
clang/test/CodeGenOpenCL/address-spaces.cl
clang/test/CodeGenOpenCL/pipe_builtin.cl
clang/test/CodeGenOpenCL/pipe_types.cl
clang/test/CodeGenOpenCL/pipe_types_mangling.cl
clang/test/Misc/opencl-c-3.0.incorrect_options.cl
clang/test/SemaOpenCL/invalid-pipes-cl1.2.cl
clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl
clang/test/SemaOpenCL/storageclass.cl