-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Use checkArgCountAtLeast instead #6380
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
Conversation
This was a post-commit review comment from @erichkeane |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
One question:
// Make sure we don't have too many arguments.
if (NumArgs > MaxNumArgs)
return Diag(TheCall->getEndLoc(),
diag::err_typecheck_call_too_many_args_at_most)
<< 0 /*function call*/ << MaxNumArgs << NumArgs
<< TheCall->getSourceRange();
``
I am wondering whether we can use checkAtMostNumArgs() functionality instead for bottom one.
That particular routine is for checking the number of arguments in an attribute, if I am not mistaken. But I could mimic checkArgCountAtLeast (in SemaChecking.cpp) and create a checkArgCountAtMost for the second check. Since this builtin would be the only one calling it, I wasn't too motivated to do that as part of this change. |
Agreed. |
The CUDA failure is unrelated to my changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a checkArgCountAtMost would be a nice addition, but up to you guys whether it is necessary for htis patch.
dbc6a69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
@premanandrao, could you please update PR description?
Thank you, done. |
Rather than replicate the code, call existing routine checkArgCountAtLeast for similar functionality.
a0fff1d
to
e5a6220
Compare
No need to review the latest force push; I did that to force testing after a rebase. (The PR is in draft status.) |
Only one test failure now: SYCL :: Assert/assert_in_simultaneous_kernels.cpp, which is unrelated to my changes. @smanna12, could you please approve my changes again? There are no changes since you last approved it, except for an empty forced push. Thanks! |
@intel/llvm-gatekeepers, this is ready for a merge. Thanks! |
Rather than replicate the code, call existing routine checkArgCountAtLeast
for similar functionality.
Add a similar routine checkArgCountAtMost to check if a call expression's
argument count exceeds the most expected. Replace where equivalent
with calls to this routine.