llvm-project/clang/test/CodeGenCoroutines
Gor Nishanov 5eb585836a [coroutines] Add codegen for await and yield expressions
Details:

Emit suspend expression which roughly looks like:

auto && x = CommonExpr();
if (!x.await_ready()) {
   llvm_coro_save();
   x.await_suspend(...);     (*)
   llvm_coro_suspend(); (**)
}
x.await_resume();
where the result of the entire expression is the result of x.await_resume()

(*) If x.await_suspend return type is bool, it allows to veto a suspend:
if (x.await_suspend(...))
   llvm_coro_suspend();
(**) llvm_coro_suspend() encodes three possible continuations as a switch instruction:

%where-to = call i8 @llvm.coro.suspend(...)
switch i8 %where-to, label %coro.ret [ ; jump to epilogue to suspend
  i8 0, label %yield.ready   ; go here when resumed
  i8 1, label %yield.cleanup ; go here when destroyed
]

llvm-svn: 298784
2017-03-26 02:18:05 +00:00
..
coro-alloc.cpp [coroutines] Build and pass coroutine_handle to await_suspend 2017-03-09 03:09:43 +00:00
coro-await.cpp [coroutines] Add codegen for await and yield expressions 2017-03-26 02:18:05 +00:00
coro-builtins-err.c [coroutines] Adding builtins for coroutine intrinsics and backendutil support. 2016-10-03 22:44:48 +00:00
coro-builtins.c [coroutines] update coro_end builtin to match llvm 2017-03-07 21:01:08 +00:00
coro-return.cpp [coroutines] Build and pass coroutine_handle to await_suspend 2017-03-09 03:09:43 +00:00
microsoft-abi-operator-coawait.cpp