From 550cc685a76b609a3c3f358d554de6e9911510ec Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 18 Jan 2024 18:05:47 +1000 Subject: [PATCH] gallivm: fix coroutines with llvm 18 llvm 18 added an extra parameters to coro end which should just take a null token always for us. Reviewed-by: Konstantin Seurer Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_coro.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_coro.c b/src/gallium/auxiliary/gallivm/lp_bld_coro.c index 0214dcf6742..75aaa7d2b84 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_coro.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_coro.c @@ -89,13 +89,18 @@ LLVMValueRef lp_build_coro_free(struct gallivm_state *gallivm, void lp_build_coro_end(struct gallivm_state *gallivm, LLVMValueRef coro_hdl) { - LLVMValueRef coro_end_args[2]; + LLVMValueRef coro_end_args[3]; + int num_args = 2; coro_end_args[0] = coro_hdl; coro_end_args[1] = LLVMConstInt(LLVMInt1TypeInContext(gallivm->context), 0, 0); +#if LLVM_VERSION_MAJOR >= 18 + coro_end_args[2] = LLVMConstNull(LLVMTokenTypeInContext(gallivm->context)); + num_args++; +#endif lp_build_intrinsic(gallivm->builder, "llvm.coro.end", LLVMInt1TypeInContext(gallivm->context), - coro_end_args, 2, 0); + coro_end_args, num_args, 0); } void lp_build_coro_resume(struct gallivm_state *gallivm, LLVMValueRef coro_hdl)