Skip to content

[NFC][SYCL] Rename poorly named diagnostic #3056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -11168,7 +11168,7 @@ def err_sycl_function_attribute_mismatch : Error<
"SYCL kernel without %0 attribute can't call a function with this attribute">;
def err_sycl_x_y_z_arguments_must_be_one : Error<
"%0 X-, Y- and Z- sizes must be 1 when %1 attribute is used with value 0">;
def err_sycl_attibute_cannot_be_applied_here
def err_sycl_attribute_internal_function
: Error<"%0 attribute cannot be applied to a "
"static function or function in an anonymous namespace">;
def err_sycl_compiletime_property_duplication : Error<
Expand Down
9 changes: 2 additions & 7 deletions clang/lib/Sema/SemaDeclAttr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4810,7 +4810,7 @@ static void handleOptimizeNoneAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
static void handleSYCLDeviceAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
auto *FD = cast<FunctionDecl>(D);
if (!FD->isExternallyVisible()) {
S.Diag(AL.getLoc(), diag::err_sycl_attibute_cannot_be_applied_here) << AL;
S.Diag(AL.getLoc(), diag::err_sycl_attribute_internal_function) << AL;
return;
}

Expand All @@ -4821,7 +4821,7 @@ static void handleSYCLDeviceIndirectlyCallableAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
auto *FD = cast<FunctionDecl>(D);
if (!FD->isExternallyVisible()) {
S.Diag(AL.getLoc(), diag::err_sycl_attibute_cannot_be_applied_here) << AL;
S.Diag(AL.getLoc(), diag::err_sycl_attribute_internal_function) << AL;
return;
}

Expand All @@ -4831,11 +4831,6 @@ static void handleSYCLDeviceIndirectlyCallableAttr(Sema &S, Decl *D,

static void handleSYCLRegisterNumAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
auto *VD = cast<VarDecl>(D);
if (!VD->hasGlobalStorage()) {
S.Diag(AL.getLoc(), diag::err_sycl_attibute_cannot_be_applied_here)
<< AL << 0;
return;
}
if (!checkAttributeNumArgs(S, AL, 1))
return;
uint32_t RegNo = 0;
Expand Down