rjmccall added a comment.

It's not optimal, but an alternative would be to force the variable to the heap 
immediately rather than waiting for a potential block copy.  The variable would 
actually be uninitialized during its "copy", so we'd need to give it a trivial 
copy helper.  But once the variable's been moved to the heap, it's never copied 
again, so that's fine.

We can force it to the heap using the public ABI for `__block` variables by 
copying and then immediately disposing of it.  (That would leave a reference 
from the stack, which is what we want.)  It would be better to have some way of 
generating it on the heap to begin it, but there's no ABI support for that 
right now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89903

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to