authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-02 18:06:21-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-02 18:06:21-07:00
log5043369e14dd98885ed88ffb6926dec94058cd46
treea0da29d472d422237119454cb82d5035f9eb8d85
parentc8e20758f65afdd043957a875d720d93c91d07db

stage1: fix a few more LLVM 15 opaque pointer bugs


1 files changed, 6 insertions(+), 6 deletions(-)

src/stage1/codegen.cpp+6-6
......@@ -4577,8 +4577,8 @@ static LLVMValueRef gen_valgrind_client_request(CodeGen *g, LLVMValueRef default
45774577 zero,
45784578 LLVMConstInt(usize_type_ref, i, false),
45794579 };
4580 LLVMValueRef elem_ptr = LLVMBuildInBoundsGEP2(g->builder, usize_type_ref,
4581 array_ptr, indexes, 2, "");
4580 LLVMValueRef elem_ptr = LLVMBuildInBoundsGEP2(g->builder,
4581 LLVMGetAllocatedType(array_ptr), array_ptr, indexes, 2, "");
45824582 LLVMBuildStore(g->builder, array_elements[i], elem_ptr);
45834583 }
45844584
......@@ -4599,7 +4599,7 @@ static LLVMValueRef gen_valgrind_client_request(CodeGen *g, LLVMValueRef default
45994599 LLVMValueRef asm_fn = LLVMGetInlineAsm(function_type, buf_ptr(asm_template), buf_len(asm_template),
46004600 buf_ptr(asm_constraints), buf_len(asm_constraints), asm_has_side_effects, asm_is_alignstack,
46014601 LLVMInlineAsmDialectATT, false);
4602 return LLVMBuildCall2(g->builder, LLVMGlobalGetValueType(asm_fn), asm_fn, param_values, input_and_output_count, "");
4602 return LLVMBuildCall2(g->builder, function_type, asm_fn, param_values, input_and_output_count, "");
46034603 }
46044604 }
46054605 zig_unreachable();
......@@ -6761,14 +6761,14 @@ static LLVMValueRef ir_render_slice(CodeGen *g, Stage1Air *executable, Stage1Air
67616761 codegen_report_errors_and_exit(g);
67626762
67636763 if (value_has_bits) {
6764 LLVMTypeRef array_llvm_ty = get_llvm_type(g, array_type);
6764 LLVMTypeRef elem_llvm_ty = get_llvm_type(g, array_type->data.pointer.child_type);
67656765 if (want_runtime_safety && sentinel != nullptr) {
6766 LLVMValueRef sentinel_elem_ptr = LLVMBuildInBoundsGEP2(g->builder, array_llvm_ty,
6766 LLVMValueRef sentinel_elem_ptr = LLVMBuildInBoundsGEP2(g->builder, elem_llvm_ty,
67676767 array_ptr, &end_val, 1, "");
67686768 add_sentinel_check(g, sentinel_elem_ptr, sentinel);
67696769 }
67706770
6771 slice_start_ptr = LLVMBuildInBoundsGEP2(g->builder, array_llvm_ty, array_ptr,
6771 slice_start_ptr = LLVMBuildInBoundsGEP2(g->builder, elem_llvm_ty, array_ptr,
67726772 &start_val, 1, "");
67736773 }
67746774