aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAnton Zabaznov <anton.zabaznov@intel.com>2021-02-05 11:15:56 +0300
committerAnton Zabaznov <anton.zabaznov@intel.com>2021-02-05 11:18:48 +0300
commita5b627aa4fe749f8df0a27fcb1f6fe3b59a21e09 (patch)
tree7899900038fa1b6bc78ea41d8eb63768ac43183e /clang/lib/Frontend/CompilerInvocation.cpp
parentb90c4907ae81e13ff3ce8a56b698e92b36a62d61 (diff)
downloadllvm-a5b627aa4fe749f8df0a27fcb1f6fe3b59a21e09.zip
llvm-a5b627aa4fe749f8df0a27fcb1f6fe3b59a21e09.tar.gz
llvm-a5b627aa4fe749f8df0a27fcb1f6fe3b59a21e09.tar.bz2
[OpenCL] Introduce new language options for OpenCL keywords.
OpenCL keywords 'pipe' and 'generic' are unconditionally supported for OpenCL C 2.0 or in OpenCL C++ mode. In OpenCL C 3.0 these keywords are available if corresponding optional core feature is supported. Reviewed By: Anastasia, svenvh Differential Revision: https://reviews.llvm.org/D95778
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index ddc16fa..0a12705 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2391,6 +2391,9 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
Opts.ZVector = 0;
Opts.setDefaultFPContractMode(LangOptions::FPM_On);
Opts.OpenCLCPlusPlus = Opts.CPlusPlus;
+ Opts.OpenCLPipe = Opts.OpenCLCPlusPlus || Opts.OpenCLVersion == 200;
+ Opts.OpenCLGenericAddressSpace =
+ Opts.OpenCLCPlusPlus || Opts.OpenCLVersion == 200;
// Include default header file for OpenCL.
if (Opts.IncludeDefaultHeader) {