From 0d0628b2d213a43f80e4967d83b905c6d2211651 Mon Sep 17 00:00:00 2001 From: Justas Janickas Date: Thu, 12 Aug 2021 16:20:11 +0100 Subject: [OpenCL] C++ for OpenCL version 2021 introduced to command line. Introduces language standard `lang_openclcpp2021` and allows `clc++2021` as a version flag for `-cl-std` in command line. Defines macros related to C++ for OpenCL version 2021. C++ for OpenCL version 2021 has been proposed in an RFC: https://lists.llvm.org/pipermail/cfe-dev/2021-August/068593.html Differential Revision: https://reviews.llvm.org/D108038 --- clang/lib/Frontend/CompilerInvocation.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 83dc6ec..eb69167 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3165,6 +3165,8 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK, Opts.OpenCLVersion = 300; else if (LangStd == LangStandard::lang_openclcpp10) Opts.OpenCLCPlusPlusVersion = 100; + else if (LangStd == LangStandard::lang_openclcpp2021) + Opts.OpenCLCPlusPlusVersion = 202100; // OpenCL has some additional defaults. if (Opts.OpenCL) { @@ -3314,6 +3316,7 @@ void CompilerInvocation::GenerateLangArgs(const LangOptions &Opts, case LangStandard::lang_opencl20: case LangStandard::lang_opencl30: case LangStandard::lang_openclcpp10: + case LangStandard::lang_openclcpp2021: StdOpt = OPT_cl_std_EQ; break; default: @@ -3612,6 +3615,7 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, .Cases("cl3.0", "CL3.0", LangStandard::lang_opencl30) .Cases("clc++", "CLC++", LangStandard::lang_openclcpp10) .Cases("clc++1.0", "CLC++1.0", LangStandard::lang_openclcpp10) + .Cases("clc++2021", "CLC++2021", LangStandard::lang_openclcpp2021) .Default(LangStandard::lang_unspecified); if (OpenCLLangStd == LangStandard::lang_unspecified) { -- cgit v1.1