[PATCH] D24068: [Coroutines] Part11: Add final suspend handling.
Gor Nishanov via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 30 20:54:24 PDT 2016
GorNishanov created this revision.
GorNishanov added a reviewer: majnemer.
GorNishanov added a subscriber: llvm-commits.
Herald added a subscriber: mehdi_amini.
A frontend may designate a particular suspend to be final, by setting the second argument of the coro.suspend intrinsic to true. Such a suspend point has two properties:
* it is possible to check whether a suspended coroutine is at the final suspend point via coro.done intrinsic;
* a resumption of a coroutine stopped at the final suspend point leads to undefined behavior. The only possible action for a coroutine at a final suspend point is destroying it via coro.destroy intrinsic.
This patch adds final suspend handling logic to CoroEarly and CoroSplit passes.
Now, the final suspend point example from docs\Coroutines.rst compiles and produces expected result (see test/Transform/Coroutines/ex5.ll).
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 11220 bytes
Desc: not available
More information about the llvm-commits