[Coroutines] Part 10: Add coroutine promise support.
authorGor Nishanov <GorNishanov@gmail.com>
Wed, 31 Aug 2016 00:35:41 +0000 (00:35 +0000)
committerGor Nishanov <GorNishanov@gmail.com>
Wed, 31 Aug 2016 00:35:41 +0000 (00:35 +0000)
commit50d7fb974ffc9fa22aed5235f6fe30ac3dc15937
tree33a53bf8ac15fa08e7e203d3adeb2432d86775ce
parent7d9ebaf3373f18536793e265bf8b81848442fbd4
[Coroutines] Part 10: Add coroutine promise support.

Summary:
1) CoroEarly now lowers llvm.coro.promise intrinsic that allows to obtain
a coroutine promise pointer from a coroutine frame and vice versa.

2) CoroFrame now interprets Promise argument of llvm.coro.begin to
place CoroutinPromise alloca at a deterministic offset from the coroutine frame.

Now, the coroutine promise example from docs\Coroutines.rst compiles and produces expected result (see test/Transform/Coroutines/ex4.ll).

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D23993

llvm-svn: 280184
llvm/lib/Transforms/Coroutines/CoroEarly.cpp
llvm/lib/Transforms/Coroutines/CoroFrame.cpp
llvm/lib/Transforms/Coroutines/CoroInstr.h
llvm/lib/Transforms/Coroutines/CoroInternal.h
llvm/lib/Transforms/Coroutines/Coroutines.cpp
llvm/test/Transforms/Coroutines/ex4.ll [new file with mode: 0644]