Skip to content

Commit 8dd6fdf

Browse files
authored
[Driver][SYCL] Deprecate usage of -sycl-std=1.2.1 (#8085)
Use of -sycl-std=1.2.1 is deprecated. Emit a diagnostic stating so. We will remove support in a future major compiler release.
1 parent 662afb4 commit 8dd6fdf

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ def warn_drv_deprecated_option : Warning<
470470
def warn_drv_deprecated_option_release : Warning<
471471
"option '%0' is deprecated and will be removed in a future release">,
472472
InGroup<Deprecated>;
473+
def warn_drv_deprecated_argument_option_release : Warning<
474+
"argument '%0' for option '%1' is deprecated and will be removed in a "
475+
"future release">, InGroup<Deprecated>;
473476
def warn_ignoring_verify_debuginfo_preserve_export : Warning<
474477
"ignoring -fverify-debuginfo-preserve-export=%0 because "
475478
"-fverify-debuginfo-preserve wasn't enabled">,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5032,6 +5032,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
50325032
A->render(Args, CmdArgs);
50335033

50345034
if (SYCLStdArg) {
5035+
// Use of -sycl-std=1.2.1 is deprecated. Emit a diagnostic stating so.
5036+
// TODO: remove support at next approprate major release.
5037+
StringRef StdValue(SYCLStdArg->getValue());
5038+
if (StdValue == "1.2.1" || StdValue == "121" ||
5039+
StdValue == "sycl-1.2.1" || StdValue == "2017")
5040+
D.Diag(diag::warn_drv_deprecated_argument_option_release)
5041+
<< StdValue << SYCLStdArg->getSpelling();
50355042
SYCLStdArg->render(Args, CmdArgs);
50365043
CmdArgs.push_back("-fsycl-std-layout-kernel-params");
50375044
} else {

clang/test/Driver/sycl-deprecated.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,17 @@
22
// RUN: %clangxx -fsycl-explicit-simd %s -### 2>&1 | FileCheck %s -DOPTION=-fsycl-explicit-simd
33
// RUN: %clangxx -fno-sycl-explicit-simd %s -### 2>&1 | FileCheck %s -DOPTION=-fno-sycl-explicit-simd
44
// CHECK: option '[[OPTION]]' is deprecated and will be removed in a future release
5+
6+
// RUN: %clangxx -fsycl -sycl-std=1.2.1 %s -### 2>&1 \
7+
// RUN: | FileCheck %s -check-prefix=CHECK-ARG -DOPTION=-sycl-std= \
8+
// RUN: -DARGUMENT=1.2.1
9+
// RUN: %clangxx -fsycl -sycl-std=121 %s -### 2>&1 \
10+
// RUN: | FileCheck %s -check-prefix=CHECK-ARG -DOPTION=-sycl-std= \
11+
// RUN: -DARGUMENT=121
12+
// RUN: %clangxx -fsycl -sycl-std=sycl-1.2.1 %s -### 2>&1 \
13+
// RUN: | FileCheck %s -check-prefix=CHECK-ARG -DOPTION=-sycl-std= \
14+
// RUN: -DARGUMENT=sycl-1.2.1
15+
// RUN: %clangxx -fsycl -sycl-std=2017 %s -### 2>&1 \
16+
// RUN: | FileCheck %s -check-prefix=CHECK-ARG -DOPTION=-sycl-std= \
17+
// RUN: -DARGUMENT=2017
18+
// CHECK-ARG: argument '[[ARGUMENT]]' for option '[[OPTION]]' is deprecated and will be removed in a future release

sycl/doc/UsersManual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ and not recommended to use in production environment.
9898
**`-sycl-std=<value>`** [EXPERIMENTAL]
9999

100100
SYCL language standard to compile for. Possible values:
101-
* 121 - SYCL 1.2.1
101+
* 121 - SYCL 1.2.1 [DEPRECATED]
102102
* 2020 - SYCL 2020
103103
It doesn't guarantee specific standard compliance, but some selected
104104
compiler features change behavior.

0 commit comments

Comments
 (0)