This is the mail archive of the gcc-cvs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

r273164 - in /branches/c++-coroutines: ChangeLo...


Author: iains
Date: Sat Jul  6 14:35:38 2019
New Revision: 273164

URL: https://gcc.gnu.org/viewcvs?rev=273164&root=gcc&view=rev
Log:
c++-coroutines - Implement suspension state checking builtin.

For at least the purpose of integrity-checking in the library, it is useful
to be able to assert that a coroutine is suspended (when that is its expected
state).

This implements __builtin_coro_is_suspended (handle), and adds a third helper
routine to the frame which is able to query the state.

2019-07-06  Iain Sandoe  <iain@sandoe.co.uk>

gcc/

	* coroutine-builtins.def (BUILT_IN_CORO_IS_SUSPENDED): New.
	* coroutine-passes.c (lower_coro_builtin): Lower suspension check
	builtin.

gcc/cp/

	* coroutines.cc (build_suspended_fn): New helper function.
	(morph_fn_to_coro): Add and populate a function pointer field for the
	suspension-checking routine.
	* cp-tree.h (morph_fn_to_coro): Alter prototype.
	* decl.c (finish_function): Generate output for the suspension check
	helper.

gcc/testsuite/

	* g++.dg/coroutines/coro-builtins.C (main): Test that we handle the
	new __builtin_coro_is_suspended builtin.


Modified:
    branches/c++-coroutines/ChangeLog.coroutines
    branches/c++-coroutines/gcc/cp/coroutines.cc
    branches/c++-coroutines/gcc/cp/cp-tree.h
    branches/c++-coroutines/gcc/cp/decl.c
    branches/c++-coroutines/gcc/testsuite/g++.dg/coroutines/coro-builtins.C


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]