Skip to content

Commit 88ed70e

Browse files
author
Anastasia Stulova
committed
[OpenCL] Rename lang mode flag for C++ mode
Rename lang mode flag to -cl-std=clc++/-cl-std=CLC++ or -std=clc++/-std=CLC++. This aligns with OpenCL C conversion and removes ambiguity with OpenCL C++. Differential Revision: https://reviews.llvm.org/D65102 llvm-svn: 367008
1 parent 2759545 commit 88ed70e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+68
-64
lines changed

clang/docs/LanguageExtensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1779,7 +1779,7 @@ invoked.
17791779
17801780
.. code-block:: console
17811781
1782-
clang -cl-std=c++ test.cl
1782+
clang -cl-std=clc++ test.cl
17831783
17841784
If there are any global objects to be initialized the final binary will
17851785
contain ``@_GLOBAL__sub_I_test.cl`` kernel to be enqueued.

clang/docs/UsersManual.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,7 +2776,7 @@ restrictions from OpenCL C v2.0 will inherently apply. All OpenCL C builtin type
27762776
and function libraries are supported and can be used in the new mode.
27772777

27782778
To enable the new mode pass the following command line option when compiling ``.cl``
2779-
file ``-cl-std=c++`` or ``-std=c++``.
2779+
file ``-cl-std=clc++``, ``-cl-std=CLC++``, ``-std=clc++`` or ``-std=CLC++``.
27802780

27812781
.. code-block:: c++
27822782

@@ -2794,7 +2794,7 @@ file ``-cl-std=c++`` or ``-std=c++``.
27942794

27952795
.. code-block:: console
27962796
2797-
clang -cl-std=c++ test.cl
2797+
clang -cl-std=clc++ test.cl
27982798
27992799
.. _target_features:
28002800

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def cl_mad_enable : Flag<["-"], "cl-mad-enable">, Group<opencl_Group>, Flags<[CC
518518
def cl_no_signed_zeros : Flag<["-"], "cl-no-signed-zeros">, Group<opencl_Group>, Flags<[CC1Option]>,
519519
HelpText<"OpenCL only. Allow use of less precise no signed zeros computations in the generated binary.">;
520520
def cl_std_EQ : Joined<["-"], "cl-std=">, Group<opencl_Group>, Flags<[CC1Option]>,
521-
HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,c++">;
521+
HelpText<"OpenCL language standard to compile for.">, Values<"cl,CL,cl1.1,CL1.1,cl1.2,CL1.2,cl2.0,CL2.0,clc++,CLC++">;
522522
def cl_denorms_are_zero : Flag<["-"], "cl-denorms-are-zero">, Group<opencl_Group>, Flags<[CC1Option]>,
523523
HelpText<"OpenCL only. Allow denormals to be flushed to zero.">;
524524
def cl_fp32_correctly_rounded_divide_sqrt : Flag<["-"], "cl-fp32-correctly-rounded-divide-sqrt">, Group<opencl_Group>, Flags<[CC1Option]>,

clang/include/clang/Frontend/LangStandards.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ LANGSTANDARD_ALIAS_DEPR(opencl10, "CL")
174174
LANGSTANDARD_ALIAS_DEPR(opencl11, "CL1.1")
175175
LANGSTANDARD_ALIAS_DEPR(opencl12, "CL1.2")
176176
LANGSTANDARD_ALIAS_DEPR(opencl20, "CL2.0")
177+
LANGSTANDARD_ALIAS_DEPR(openclcpp, "CLC++")
177178

178179
// CUDA
179180
LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)",

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2433,7 +2433,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
24332433
.Cases("cl1.1", "CL1.1", LangStandard::lang_opencl11)
24342434
.Cases("cl1.2", "CL1.2", LangStandard::lang_opencl12)
24352435
.Cases("cl2.0", "CL2.0", LangStandard::lang_opencl20)
2436-
.Case("c++", LangStandard::lang_openclcpp)
2436+
.Cases("clc++", "CLC++", LangStandard::lang_openclcpp)
24372437
.Default(LangStandard::lang_unspecified);
24382438

24392439
if (OpenCLLangStd == LangStandard::lang_unspecified) {

clang/test/CodeGenCXX/mangle-address-space.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s --check-prefixes=CHECK,CHECKNOOCL
22
// RUN: %clang_cc1 -emit-llvm -triple x86_64-windows-msvc -o - %s | FileCheck %s --check-prefixes=WIN,WINNOOCL
3-
// RUN: %clang_cc1 -cl-std=c++ -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s --check-prefixes=CHECK,CHECKOCL
4-
// RUN: %clang_cc1 -cl-std=c++ -emit-llvm -triple x86_64-windows-msvc -o - %s | FileCheck %s --check-prefixes=WIN,WINOCL
3+
// RUN: %clang_cc1 -cl-std=clc++ -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s --check-prefixes=CHECK,CHECKOCL
4+
// RUN: %clang_cc1 -cl-std=clc++ -emit-llvm -triple x86_64-windows-msvc -o - %s | FileCheck %s --check-prefixes=WIN,WINOCL
55

66
// CHECKNOOCL-LABEL: define {{.*}}void @_Z2f0Pc
77
// WINNOOCL-LABEL: define {{.*}}void @"?f0@@YAXPEAD@Z"

clang/test/CodeGenOpenCL/builtins.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 %s -finclude-default-header -cl-std=c++ -fblocks -O0 -emit-llvm -o - -triple "spir-unknown-unknown" | FileCheck %s
1+
// RUN: %clang_cc1 %s -finclude-default-header -cl-std=clc++ -fblocks -O0 -emit-llvm -o - -triple "spir-unknown-unknown" | FileCheck %s
22

33
void testBranchingOnEnqueueKernel(queue_t default_queue, unsigned flags, ndrange_t ndrange) {
44
// Ensure `enqueue_kernel` can be branched upon.

clang/test/CodeGenOpenCL/images.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -emit-llvm -o - | FileCheck %s
2-
// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -emit-llvm -o - -cl-std=c++ | FileCheck %s
2+
// RUN: %clang_cc1 %s -triple x86_64-unknown-linux-gnu -O0 -emit-llvm -o - -cl-std=clc++ | FileCheck %s
33

44
__attribute__((overloadable)) void read_image(read_only image1d_t img_ro);
55
__attribute__((overloadable)) void read_image(write_only image1d_t img_wo);

clang/test/CodeGenOpenCL/logical-ops.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL1.2 -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
2-
// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=c++ -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
2+
// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=clc++ -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s
33

44
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
55

clang/test/CodeGenOpenCL/pipe_builtin.cl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=c++ -o - %s | FileCheck %s
1+
// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -cl-ext=+cl_khr_subgroups -O0 -cl-std=clc++ -o - %s | FileCheck %s
22
// FIXME: Add MS ABI manglings of OpenCL things and remove %itanium_abi_triple
33
// above to support OpenCL in the MS C++ ABI.
44

0 commit comments

Comments
 (0)