Replaced Codegen field access by trait method

This commit is contained in:
Denis Merigoux
2018-08-28 17:50:57 +02:00
committed by Eduard-Mihai Burtescu
parent 8714e6bce6
commit d325844804
16 changed files with 247 additions and 247 deletions

View File

@@ -41,10 +41,10 @@ impl<'a, 'tcx> VirtualIndex {
// Load the data pointer from the object.
debug!("get_fn({:?}, {:?})", llvtable, self);
let llvtable = bx.pointercast(llvtable, fn_ty.ptr_to_llvm_type(bx.cx).ptr_to());
let llvtable = bx.pointercast(llvtable, fn_ty.ptr_to_llvm_type(bx.cx()).ptr_to());
let ptr_align = bx.tcx().data_layout.pointer_align;
let ptr = bx.load(
bx.inbounds_gep(llvtable, &[CodegenCx::c_usize(bx.cx, self.0)]),
bx.inbounds_gep(llvtable, &[CodegenCx::c_usize(bx.cx(), self.0)]),
ptr_align
);
bx.nonnull_metadata(ptr);
@@ -61,10 +61,10 @@ impl<'a, 'tcx> VirtualIndex {
// Load the data pointer from the object.
debug!("get_int({:?}, {:?})", llvtable, self);
let llvtable = bx.pointercast(llvtable, Type::isize(bx.cx).ptr_to());
let llvtable = bx.pointercast(llvtable, Type::isize(bx.cx()).ptr_to());
let usize_align = bx.tcx().data_layout.pointer_align;
let ptr = bx.load(
bx.inbounds_gep(llvtable, &[CodegenCx::c_usize(bx.cx, self.0)]),
bx.inbounds_gep(llvtable, &[CodegenCx::c_usize(bx.cx(), self.0)]),
usize_align
);
// Vtable loads are invariant