Skip to content

Commit 83c897e

Browse files
authored
[NFC][SYCL] Rename poorly named diagnostic (#3056)
1 parent a599c44 commit 83c897e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -11202,7 +11202,7 @@ def err_sycl_function_attribute_mismatch : Error<
1120211202
"SYCL kernel without %0 attribute can't call a function with this attribute">;
1120311203
def err_sycl_x_y_z_arguments_must_be_one : Error<
1120411204
"%0 X-, Y- and Z- sizes must be 1 when %1 attribute is used with value 0">;
11205-
def err_sycl_attibute_cannot_be_applied_here
11205+
def err_sycl_attribute_internal_function
1120611206
: Error<"%0 attribute cannot be applied to a "
1120711207
"static function or function in an anonymous namespace">;
1120811208
def err_sycl_compiletime_property_duplication : Error<

clang/lib/Sema/SemaDeclAttr.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -4833,7 +4833,7 @@ static void handleOptimizeNoneAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
48334833
static void handleSYCLDeviceAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
48344834
auto *FD = cast<FunctionDecl>(D);
48354835
if (!FD->isExternallyVisible()) {
4836-
S.Diag(AL.getLoc(), diag::err_sycl_attibute_cannot_be_applied_here) << AL;
4836+
S.Diag(AL.getLoc(), diag::err_sycl_attribute_internal_function) << AL;
48374837
return;
48384838
}
48394839

@@ -4844,7 +4844,7 @@ static void handleSYCLDeviceIndirectlyCallableAttr(Sema &S, Decl *D,
48444844
const ParsedAttr &AL) {
48454845
auto *FD = cast<FunctionDecl>(D);
48464846
if (!FD->isExternallyVisible()) {
4847-
S.Diag(AL.getLoc(), diag::err_sycl_attibute_cannot_be_applied_here) << AL;
4847+
S.Diag(AL.getLoc(), diag::err_sycl_attribute_internal_function) << AL;
48484848
return;
48494849
}
48504850

@@ -4854,11 +4854,6 @@ static void handleSYCLDeviceIndirectlyCallableAttr(Sema &S, Decl *D,
48544854

48554855
static void handleSYCLRegisterNumAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
48564856
auto *VD = cast<VarDecl>(D);
4857-
if (!VD->hasGlobalStorage()) {
4858-
S.Diag(AL.getLoc(), diag::err_sycl_attibute_cannot_be_applied_here)
4859-
<< AL << 0;
4860-
return;
4861-
}
48624857
if (!checkAttributeNumArgs(S, AL, 1))
48634858
return;
48644859
uint32_t RegNo = 0;

0 commit comments

Comments
 (0)