diff options
author | Gor Nishanov <GorNishanov@gmail.com> | 2018-04-02 16:55:12 +0000 |
---|---|---|
committer | Gor Nishanov <GorNishanov@gmail.com> | 2018-04-02 16:55:12 +0000 |
commit | b0316d96ae563c8e6473952d3213e833961c81ff (patch) | |
tree | 7ff5838f27df91f410829e9b6eb4a277950db45b /llvm/docs/Coroutines.rst | |
parent | 49d802862d5edf762928cb2ee159614f31eb2364 (diff) | |
download | bcm5719-llvm-b0316d96ae563c8e6473952d3213e833961c81ff.tar.gz bcm5719-llvm-b0316d96ae563c8e6473952d3213e833961c81ff.zip |
[coroutines] Add support for llvm.coro.noop intrinsics
Summary:
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.
Reviewers: EricWF, modocache, rnk, lewissbaker
Reviewed By: modocache
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D45114
llvm-svn: 328986
Diffstat (limited to 'llvm/docs/Coroutines.rst')
-rw-r--r-- | llvm/docs/Coroutines.rst | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/llvm/docs/Coroutines.rst b/llvm/docs/Coroutines.rst index 1bea04ebdd2..f3667585c6c 100644 --- a/llvm/docs/Coroutines.rst +++ b/llvm/docs/Coroutines.rst @@ -880,6 +880,32 @@ Example: %phi = phi i8* [ null, %entry ], [ %alloc, %coro.alloc ] %frame = call i8* @llvm.coro.begin(token %id, i8* %phi) +.. _coro.noop: + +'llvm.coro.noop' Intrinsic +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +:: + + declare i8* @llvm.coro.noop() + +Overview: +""""""""" + +The '``llvm.coro.noop``' intrinsic returns an address of the coroutine frame of +a coroutine that does nothing when resumed or destroyed. + +Arguments: +"""""""""" + +None + +Semantics: +"""""""""" + +This intrinsic is lowered to refer to a private constant coroutine frame. The +resume and destroy handlers for this frame are empty functions that do nothing. +Note that in different translation units llvm.coro.noop may return different pointers. + .. _coro.frame: 'llvm.coro.frame' Intrinsic |