[coroutines] Add __builtin_coro_noop => llvm.coro.noop
authorGor Nishanov <GorNishanov@gmail.com>
Mon, 2 Apr 2018 17:35:37 +0000 (17:35 +0000)
committerGor Nishanov <GorNishanov@gmail.com>
Mon, 2 Apr 2018 17:35:37 +0000 (17:35 +0000)
commit2a78fa5209ad5bf86dd29a9e75d12802ff907495
treea14ac5ef8aec21ff6a92d64e3b79a7e1928a60d8
parent868112181b596ec4f310dc4442e93379d0217bdd
[coroutines] Add __builtin_coro_noop => llvm.coro.noop

A recent addition to Coroutines TS (https://wg21.link/p0913) adds a pre-defined
coroutine noop_coroutine that does nothing. To implement this feature, we implemented
an llvm.coro.noop intrinsic that returns a coroutine handle to a coroutine that
does nothing when resumed or destroyed.

This patch adds a builtin __builtin_coro_noop() that maps to llvm.coro.noop intrinsic.

Related llvm change: https://reviews.llvm.org/D45114

llvm-svn: 328993
clang/include/clang/Basic/Builtins.def
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGenCoroutines/coro-builtins.c