We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bc901e commit 0027511Copy full SHA for 0027511
compiler/rustc_codegen_llvm/src/va_arg.rs
@@ -28,9 +28,12 @@ fn round_pointer_up_to_alignment<'ll>(
28
align: Align,
29
ptr_ty: &'ll Type,
30
) -> &'ll Value {
31
- let mut ptr_as_int = bx.ptrtoint(addr, bx.cx().type_isize());
32
- ptr_as_int = round_up_to_alignment(bx, ptr_as_int, align);
33
- bx.inttoptr(ptr_as_int, ptr_ty)
+ let ptr = bx.inbounds_ptradd(addr, bx.const_i32(align.bytes() as i32 - 1));
+ bx.call_intrinsic(
+ "llvm.ptrmask",
34
+ &[ptr_ty, bx.type_i32()],
35
+ &[ptr, bx.const_int(bx.isize_ty, -(align.bytes() as isize) as i64)],
36
+ )
37
}
38
39
fn emit_direct_ptr_va_arg<'ll, 'tcx>(
0 commit comments