Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
SILGen: Allow +0 parameter forwarding in protocol witness and re-abstraction thunks #6485
When emitting a thunk, such as a protocol witness thunk, we pass the arguments of the thunk to the callee, possibly performing some transformations on those parameters, such as converting indirect parameters to direct parameters.
If the parameters were owned or +1, we would pass them along to the callee. If the parameter was +0, we would perform an elaborate dance where we would copy or retain the value, pass the copy to the callee, and then destroy or release the copy. This is unnecessary, and a +0 value can be forwarded just like a +1 value.
1 similar comment
Build comment file:
No Changes (273)
No Changes (236)