Skip to content

Commit

Permalink
introduce and use ptradd/inbounds_ptradd instead of gep
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdesjardins committed Feb 27, 2024
1 parent 19a6482 commit 70346fe
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,11 +839,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
let llptr = if i == 0 {
place.llval
} else {
self.inbounds_gep(
self.type_i8(),
place.llval,
&[self.const_usize(b_offset.bytes())],
)
self.inbounds_ptradd(place.llval, self.const_usize(b_offset.bytes()))
};
let llty = place.layout.scalar_pair_element_gcc_type(self, i);
let load = self.load(llty, llptr, align);
Expand Down

0 comments on commit 70346fe

Please sign in to comment.