gallivm: use LLVM opaque pointers in lp_bld_assert.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>
This commit is contained in:
Mihai Preda 2022-05-02 15:32:25 +03:00 committed by Mihai Preda
parent 1e1ebbe6df
commit 70e9db951d

View file

@ -75,9 +75,11 @@ lp_build_assert(struct gallivm_state *gallivm,
arg_types[0] = LLVMInt32TypeInContext(context);
arg_types[1] = LLVMPointerType(LLVMInt8TypeInContext(context), 0);
function = lp_build_const_func_pointer(gallivm,
LLVMTypeRef function_type = LLVMFunctionType(ret_type, arg_types, 2, 0);
function = lp_build_const_func_pointer_from_type(gallivm,
func_to_pointer((func_pointer)lp_assert),
ret_type, arg_types, ARRAY_SIZE(arg_types),
function_type,
"assert");
/* build function call param list */
@ -87,6 +89,5 @@ lp_build_assert(struct gallivm_state *gallivm,
/* check arg types */
assert(LLVMTypeOf(args[0]) == arg_types[0]);
assert(LLVMTypeOf(args[1]) == arg_types[1]);
LLVMBuildCall(builder, function, args, ARRAY_SIZE(args), "");
LLVMBuildCall2(builder, function_type, function, args, ARRAY_SIZE(args), "");
}