Rename unsigned_offset_from
to sub_ptr
This commit is contained in:
parent
06817d1bb3
commit
bb7b844d7c
1 changed files with 1 additions and 1 deletions
|
@ -721,7 +721,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
|
||||||
let diff_bytes = fx.bcx.ins().isub(ptr, base);
|
let diff_bytes = fx.bcx.ins().isub(ptr, base);
|
||||||
// FIXME this can be an exact division.
|
// FIXME this can be an exact division.
|
||||||
let diff = if intrinsic == sym::ptr_offset_from_unsigned {
|
let diff = if intrinsic == sym::ptr_offset_from_unsigned {
|
||||||
// Because diff_bytes ULT isize::MAX, this would be fine as signed,
|
// Because diff_bytes ULE isize::MAX, this would be fine as signed,
|
||||||
// but unsigned is slightly easier to codegen, so might as well.
|
// but unsigned is slightly easier to codegen, so might as well.
|
||||||
fx.bcx.ins().udiv_imm(diff_bytes, pointee_size as i64)
|
fx.bcx.ins().udiv_imm(diff_bytes, pointee_size as i64)
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue