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

Conversation

Fznamznon
Copy link
Contributor

No description provided.

@@ -4832,8 +4832,7 @@ 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;
S.Diag(AL.getLoc(), diag::err_sycl_attribute_internal_function) << AL << 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I just took a closer look. Why is a diagnostic about static function/function in anonymous namespace being generated for a variable. This is out of scope of your patch but this looks like incorrect diagnostic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it was added by @kbobrovs in scope of #1756 . Usage of this diagnostic seems a bit odd and untested.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I have to fix it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we'd like to upstream at some point, I'd recommend fixing it. (I think it's in scope for this patch given that the diagnostic quality is being regressed, FWIW).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. register_num has only 'GlobalVar' in subjects list, so it seems the part of the code where this diagnostic was incorrectly used is dead code. Removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we'd like to upstream at some point

Go for it! :-)

Copy link
Contributor

@elizabethandrews elizabethandrews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bader bader merged commit 83c897e into intel:sycl Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants