| 1 |
/* This file contains the definitions and documentation for the |
| 2 |
coroutines builtins used in GCC. |
| 3 |
|
| 4 |
Copyright (C) 2018-2025 Free Software Foundation, Inc. |
| 5 |
|
| 6 |
Contributed by Iain Sandoe <[email protected]> under contract to Facebook. |
| 7 |
|
| 8 |
This file is part of GCC. |
| 9 |
|
| 10 |
GCC is free software; you can redistribute it and/or modify it under |
| 11 |
the terms of the GNU General Public License as published by the Free |
| 12 |
Software Foundation; either version 3, or (at your option) any later |
| 13 |
version. |
| 14 |
|
| 15 |
GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
| 16 |
WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 17 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 18 |
for more details. |
| 19 |
|
| 20 |
You should have received a copy of the GNU General Public License |
| 21 |
along with GCC; see the file COPYING3. If not see |
| 22 |
<http://www.gnu.org/licenses/>. */ |
| 23 |
|
| 24 |
/* Before including this file, you should define a macro: |
| 25 |
|
| 26 |
DEF_BUILTIN_STUB(ENUM, NAME) |
| 27 |
DEF_COROUTINE_BUILTIN (ENUM, NAME, TYPE, ATTRS) |
| 28 |
|
| 29 |
See builtins.def for details. |
| 30 |
The builtins are created used by library implementations of C++ |
| 31 |
coroutines. */ |
| 32 |
|
| 33 |
/* This has to come before all the coroutine builtins. */ |
| 34 |
DEF_BUILTIN_STUB (BEGIN_COROUTINE_BUILTINS, (const char *) 0) |
| 35 |
|
| 36 |
/* These are the builtins that are externally-visible and used by the |
| 37 |
standard library implementation of the coroutine header. */ |
| 38 |
|
| 39 |
DEF_COROUTINE_BUILTIN (BUILT_IN_CORO_PROMISE, "promise", |
| 40 |
BT_FN_PTR_PTR_CONST_SIZE_BOOL, |
| 41 |
ATTR_CONST_NOTHROW_LEAF_LIST) |
| 42 |
|
| 43 |
DEF_COROUTINE_BUILTIN (BUILT_IN_CORO_RESUME, "resume", BT_FN_VOID_PTR, |
| 44 |
ATTR_NULL) |
| 45 |
|
| 46 |
DEF_COROUTINE_BUILTIN (BUILT_IN_CORO_DESTROY, "destroy", BT_FN_VOID_PTR, |
| 47 |
ATTR_NULL) |
| 48 |
|
| 49 |
DEF_COROUTINE_BUILTIN (BUILT_IN_CORO_DONE, "done", BT_FN_BOOL_PTR, |
| 50 |
ATTR_NOTHROW_LEAF_LIST) |
| 51 |
|
| 52 |
/* This has to come after all the coroutine builtins. */ |
| 53 |
DEF_BUILTIN_STUB (END_COROUTINE_BUILTINS, (const char *) 0) |