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 <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27133>
This commit is contained in:
Dave Airlie
2024-01-18 18:05:47 +10:00
committed by Marge Bot
parent 3b62b0d096
commit 550cc685a7

View File

@@ -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)