This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Implement correct GRO lifetime
ClosedPublic

Authored by GorNishanov on May 23 2017, 7:26 PM.

Details

Summary

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)

Diff Detail

Repository
rL LLVM

Event Timeline

GorNishanov created this revision.May 23 2017, 7:26 PM
GorNishanov accepted this revision.May 23 2017, 7:27 PM
This revision is now accepted and ready to land.May 23 2017, 7:27 PM
This revision was automatically updated to reflect the committed changes.