From a5b627aa4fe749f8df0a27fcb1f6fe3b59a21e09 Mon Sep 17 00:00:00 2001 From: Anton Zabaznov Date: Fri, 5 Feb 2021 11:15:56 +0300 Subject: [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 --- clang/lib/Frontend/CompilerInvocation.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') 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) { -- cgit v1.1