mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
va_arg: use emit_ptr_va_arg for mips
This commit is contained in:
@@ -1171,14 +1171,29 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
|
||||
AllowHigherAlign::Yes,
|
||||
ForceRightAdjust::No,
|
||||
),
|
||||
Arch::Mips | Arch::Mips32r6 | Arch::Mips64 | Arch::Mips64r6 => emit_ptr_va_arg(
|
||||
bx,
|
||||
addr,
|
||||
target_ty,
|
||||
PassMode::Direct,
|
||||
match &target.llvm_abiname {
|
||||
LlvmAbi::N32 | LlvmAbi::N64 => SlotSize::Bytes8,
|
||||
LlvmAbi::O32 => SlotSize::Bytes4,
|
||||
other => bug!("unexpected LLVM ABI {other}"),
|
||||
},
|
||||
AllowHigherAlign::Yes,
|
||||
// In big-endian mode the actual value is stored in the right side of the slot, meaning
|
||||
// that when the value is smaller than a slot, we need to adjust the pointer we read
|
||||
// to somewhere in the middle of the slot.
|
||||
match bx.tcx().sess.target.endian {
|
||||
Endian::Big => ForceRightAdjust::Yes,
|
||||
Endian::Little => ForceRightAdjust::No,
|
||||
},
|
||||
),
|
||||
|
||||
Arch::Bpf => bug!("bpf does not support c-variadic functions"),
|
||||
Arch::SpirV => bug!("spirv does not support c-variadic functions"),
|
||||
|
||||
Arch::Mips | Arch::Mips32r6 | Arch::Mips64 | Arch::Mips64r6 => {
|
||||
// FIXME: port MipsTargetLowering::lowerVAARG.
|
||||
bx.va_arg(addr.immediate(), bx.cx.layout_of(target_ty).llvm_type(bx.cx))
|
||||
}
|
||||
Arch::Sparc | Arch::Avr | Arch::M68k | Arch::Msp430 => {
|
||||
// Clang uses the LLVM implementation for these architectures.
|
||||
bx.va_arg(addr.immediate(), bx.cx.layout_of(target_ty).llvm_type(bx.cx))
|
||||
|
||||
Reference in New Issue
Block a user