Skip to content
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

[SYCL] Report deferred diagnostics in function templates #5114

Merged
merged 8 commits into from
Jan 21, 2022

Conversation

premanandrao
Copy link
Contributor

Under some circumstances, deferred diagnostics were not
emitted for usages within a template function. This was
because the FunctionDecl associated with the diagnostic
was that of the template declaration, but at the point of
emitting the diagnostic, the FunctionDecl in the call chain
was that of the template instantiation.

Signed-off-by: Premanand M Rao premanand.m.rao@intel.com

@premanandrao
Copy link
Contributor Author

I have marked this "draft" because I am not really sure if there is a better way to handle this. Please take a look and offer suggestions for a different approach if you think of any.

clang/lib/Sema/Sema.cpp Outdated Show resolved Hide resolved
@premanandrao
Copy link
Contributor Author

Sorry for the forced update. Branches were out of sync.

@premanandrao
Copy link
Contributor Author

I am looking at the failing test.

Under some circumstances, deferred diagnostics were not
emitted for usages within a template function.  This was
because the FunctionDecl associated with the diagnostic
was that of the template declaration, but at the point of
emitting the diagnostic, the FunctionDecl in the call chain
was that of the template instantiation.

Signed-off-by: Premanand M Rao <premanand.m.rao@intel.com>
@premanandrao
Copy link
Contributor Author

I had to rebase. There were some interactions between PR #5195 and this one. I have resolved one test which had a FIXME in it.

@premanandrao
Copy link
Contributor Author

@Fznamznon, @elizabethandrews, @smanna12, this is ready for a review, whenever you get a chance.

Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

Only a couple of minors. Why don't you make it as "ready for review" BTW?

clang/test/SemaSYCL/sycl-device-template-diag.cpp Outdated Show resolved Hide resolved
@premanandrao premanandrao marked this pull request as ready for review January 19, 2022 22:05
@premanandrao premanandrao requested a review from a team as a code owner January 19, 2022 22:05
@premanandrao
Copy link
Contributor Author

premanandrao commented Jan 19, 2022

Why don't you make it as "ready for review" BTW?

Duh! Thanks. :-)

smanna12
smanna12 previously approved these changes Jan 20, 2022
Copy link
Contributor

@smanna12 smanna12 left a comment

Choose a reason for hiding this comment

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

LGTM

@bader bader requested a review from Fznamznon January 20, 2022 09:44
Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

Just a NIT, otherwise LGTM.

clang/test/SemaSYCL/sycl-device-template-diag.cpp Outdated Show resolved Hide resolved
@premanandrao
Copy link
Contributor Author

LGTM

Thanks @smanna12

@premanandrao
Copy link
Contributor Author

Thanks @Fznamznon for the approval as well as the thorough review.

@bader bader merged commit d0efca5 into intel:sycl Jan 21, 2022
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.

4 participants