diff options
| author | Gor Nishanov <GorNishanov@gmail.com> | 2018-04-02 17:35:37 +0000 |
|---|---|---|
| committer | Gor Nishanov <GorNishanov@gmail.com> | 2018-04-02 17:35:37 +0000 |
| commit | 2a78fa5209ad5bf86dd29a9e75d12802ff907495 (patch) | |
| tree | a14ac5ef8aec21ff6a92d64e3b79a7e1928a60d8 /clang/lib/CodeGen | |
| parent | 868112181b596ec4f310dc4442e93379d0217bdd (diff) | |
| download | bcm5719-llvm-2a78fa5209ad5bf86dd29a9e75d12802ff907495.tar.gz bcm5719-llvm-2a78fa5209ad5bf86dd29a9e75d12802ff907495.zip | |
[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
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 79e571c2a6e..2692088d6b2 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -2796,6 +2796,8 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, return EmitCoroutineIntrinsic(E, Intrinsic::coro_resume); case Builtin::BI__builtin_coro_frame: return EmitCoroutineIntrinsic(E, Intrinsic::coro_frame); + case Builtin::BI__builtin_coro_noop: + return EmitCoroutineIntrinsic(E, Intrinsic::coro_noop); case Builtin::BI__builtin_coro_free: return EmitCoroutineIntrinsic(E, Intrinsic::coro_free); case Builtin::BI__builtin_coro_destroy: |

