From 4560efe46c476cf794fa0ce4efb8db5aa55a3351 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sun, 4 Jul 2021 18:53:04 +0200 Subject: Pass type when creating load This makes load generation compatible with opaque pointers. The generation of nontemporal copies still accesses the pointer element type, as fixing this requires more movement. --- compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_codegen_llvm/src/llvm') diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 3f629220328..2ade66ac41e 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -1385,7 +1385,12 @@ extern "C" { Val: &'a Value, Name: *const c_char, ) -> &'a Value; - pub fn LLVMBuildLoad(B: &Builder<'a>, PointerVal: &'a Value, Name: *const c_char) -> &'a Value; + pub fn LLVMBuildLoad2( + B: &Builder<'a>, + Ty: &'a Type, + PointerVal: &'a Value, + Name: *const c_char, + ) -> &'a Value; pub fn LLVMBuildStore(B: &Builder<'a>, Val: &'a Value, Ptr: &'a Value) -> &'a Value; -- cgit 1.4.1-3-g733a5