Index: include/llvm/IR/Intrinsics.td =================================================================== --- include/llvm/IR/Intrinsics.td +++ include/llvm/IR/Intrinsics.td @@ -591,7 +591,32 @@ [llvm_token_ty, llvm_i32_ty, llvm_i32_ty], [IntrReadMem]>; -//===-------------------------- Other Intrinsics --------------------------===// +//===------------------------ Coroutine Intrinsics ---------------===// +// These are documented in docs/Coroutines.rst + +def int_coro_alloc : Intrinsic<[llvm_ptr_ty], [], []>; +def int_coro_begin : Intrinsic<[llvm_ptr_ty], + [llvm_ptr_ty, llvm_i32_ty, + llvm_ptr_ty, llvm_ptr_ty], []>; +def int_coro_free : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty], []>; +def int_coro_end : Intrinsic<[], [llvm_ptr_ty, llvm_i1_ty], []>; + +def int_coro_frame : Intrinsic<[llvm_ptr_ty], [], [IntrNoMem]>; +def int_coro_size : Intrinsic<[llvm_anyint_ty], [llvm_ptr_ty], [IntrNoMem]>; + +def int_coro_save : Intrinsic<[llvm_token_ty], [llvm_ptr_ty], []>; +def int_coro_suspend : Intrinsic<[llvm_i8_ty], [llvm_token_ty, llvm_i1_ty], []>; + +def int_coro_param : Intrinsic<[llvm_i1_ty], [llvm_ptr_ty, llvm_ptr_ty], [IntrReadMem]>; + +def int_coro_resume : Intrinsic<[], [llvm_ptr_ty], [Throws]>; +def int_coro_destroy : Intrinsic<[], [llvm_ptr_ty], [Throws]>; +def int_coro_done : Intrinsic<[llvm_i1_ty], [llvm_ptr_ty], [IntrReadMem]>; +def int_coro_promise : Intrinsic<[llvm_anyptr_ty], [llvm_ptr_ty], [IntrReadMem]>; +def int_coro_from_promise : Intrinsic<[llvm_ptr_ty], [llvm_anyptr_ty], [IntrReadMem]>; + +def int_coro_subfn_addr : Intrinsic<[llvm_ptr_ty], [llvm_ptr_ty, llvm_i8_ty], [IntrReadMem]>; +///===-------------------------- Other Intrinsics --------------------------===// // def int_flt_rounds : Intrinsic<[llvm_i32_ty]>, GCCBuiltin<"__builtin_flt_rounds">;