[PATCH] D58514: Avoid needlessly copying blocks that initialize or are assigned to local auto variables to the heap

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 12:23:23 PDT 2019


rjmccall added a comment.

In D58514#1435228 <https://reviews.llvm.org/D58514#1435228>, @wuhao5 wrote:

> > Okay, so really just a block self-reference.  We could really just add a feature for that that would avoid both the complexity and the expense of the self-capture dance.
>
> Is there a plan to cover this case? or is it a legitimate use case that Clang should handle?


You are currently relying on something that ARC doesn't guarantee, so the client code should be fixed to explicitly copy the block.  I think we would be happy to consider a proposal in the long run to allow blocks to self-reference more easily, which will effectively bypass the problem.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58514/new/

https://reviews.llvm.org/D58514





More information about the cfe-commits mailing list