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

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 13 17:19:08 PDT 2019


dexonsmith added a comment.

In D58514#1428567 <https://reviews.llvm.org/D58514#1428567>, @ahatanak wrote:

> Sorry, I misread the code. If you change the parameter type of `bar` to `BlockTy`, the code crashes. If the type is `id`, it doesn't crash because IRGen copies the block to the heap in `foo` before passing it to `bar`.


Okay, that's what I expected.  (You didn't misread, I had just mistyped :/.)

How insane would it be to add a copy/dispose pair around assignments of blocks to weak references?


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