[PATCH] D33477: [coroutines] Implement correct GRO lifetime

Gor Nishanov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 19:27:01 PDT 2017


GorNishanov created this revision.
Herald added a subscriber: EricWF.

Sema creates a declaration for gro variable as:

auto $gro = $promise.get_return_object();

However, gro variable has to outlive coroutine frame and coroutine promise, but,
it can only be initialized after the coroutine promise was created, thus, we
split its emission in two parts: EmitGroAlloca emits an alloca and sets up
the cleanups. Later when the coroutine promise is available we initialize
the gro and set the flag that the cleanup is now active.

Duplicate of: https://reviews.llvm.org/D31670 (which arc patch refuses to apply for some reason)


https://reviews.llvm.org/D33477

Files:
  lib/CodeGen/CGCoroutine.cpp
  test/CodeGenCoroutines/coro-gro.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33477.100029.patch
Type: text/x-patch
Size: 6759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170524/204dc3b2/attachment-0001.bin>


More information about the cfe-commits mailing list