-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Member binding operators #3720
Member binding operators #3720
Conversation
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.
I think there's good detail here on ValueBind
and RefBind
. I do have several questions about extend api
; it's not clear to me what the implementation of this would look like, so I'd like to have more specifics.
Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
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.
Looks good to me; I think this is ready to go ahead. There's one thing I'd like double-checked here, and one more coherence concern, but I think the latter is pre-existing so shouldn't block this proposal.
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.
Looks good, thanks!
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 as well!!!
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
Instead of the `call` instruction having a block with one argument per explicit argument, preceded optionally by `self` and followed optionally by a return slot, change the `call` to store only the *runtime* arguments. Store an index on the runtime parameters to make it easier to determine the correspondence between arguments and parameters in a call. Compile-time parameters, whether implicit or explicit, are no longer included in the call argument list. Instead, they're tracked only in the `specific_id` on the callee. For calls to generic classes and generic interfaces, it no longer makes sense to form a `call` instruction, given that the entirety of the result is determined by the `specific_id`, which is now formed when checking the call. Instead, the `call` instruction now only models function calls, and not calls to other kinds of parameterized entity names, and we create a `class_type` or `interface_type` instead of a `call` instruction to model these kinds of calls. Notionally the model here is that we're following the #3720 approach for calls, but for now we inline the `Call.Op` function when forming SemIR. We now also track the enclosing specific for a generic class or generic interface that appears within an enclosing generic. This is necessary in order for deduction of the inner generic parameters to not get confused by the outer generic parameters being absent. In order to not regress diagnostics, the template argument deduction mechanism has been extended to specify the name of the parameter we're deducing against when possible, and call arity mismatch errors are now diagnosed before performing deduction rather than afterwards.
Define the binding operation used to compute the result of
x.y
,p->y
,x.(C.y)
, andp->(C.y)
as calling a method from user-implementable interfaces.