[PATCH] D57797: Variable auto-init: fix __block initialization

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 7 16:00:54 PST 2019

rjmccall added inline comments.

Comment at: lib/CodeGen/CGDecl.cpp:1726
+    emitByrefStructureInit(emission);
+  }
jfb wrote:
> Note that we still want this to be pulled out in this way because `emitByrefStructureInit` emits the call to the initializer (in `test_block_self_init` the call to `create`). Were we to leave this as it was before, one of the initializations below would be emitted, but it would be *after* the call.
> Similarly, we also want the little dance I added to only initialize once.
Oh, that's interesting, I hadn't remembered that.  Alright, in that case LGTM, I guess.

...unless you want to refactor this so that `emitByrefStructureInit` only handles the header initialization and the bit about handling the initializer is handled more cleanly down in the rest of this code.

  rC Clang



More information about the cfe-commits mailing list