From 4ff7e64e81c0b4acb39c841b6d8da7ebc8bdd6dd Mon Sep 17 00:00:00 2001 From: Mihai Preda Date: Mon, 22 Aug 2022 16:34:30 +0300 Subject: [PATCH] gallivm: fixes for LLVM-15 opaque pointers in lp_bld_struct.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/auxiliary/gallivm/lp_bld_struct.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_struct.c b/src/gallium/auxiliary/gallivm/lp_bld_struct.c index 4259ecfa0d4..fa25b4ac312 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_struct.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_struct.c @@ -109,7 +109,8 @@ lp_build_struct_get2(struct gallivm_state *gallivm, assert(LLVMGetTypeKind(LLVMTypeOf(ptr)) == LLVMPointerTypeKind); assert(LLVM_VERSION_MAJOR >= 15 || LLVMGetTypeKind(LLVMGetElementType(LLVMTypeOf(ptr))) == LLVMStructTypeKind); member_ptr = lp_build_struct_get_ptr2(gallivm, ptr_type, ptr, member, name); - res = LLVMBuildLoad(gallivm->builder, member_ptr, ""); + LLVMTypeRef member_type = LLVMStructGetTypeAtIndex(ptr_type, member); + res = LLVMBuildLoad2(gallivm->builder, member_type, member_ptr, ""); lp_build_name(res, "%s.%s", LLVMGetValueName(ptr), name); return res; }