diff --git a/compiler/rustc_target/src/callconv/powerpc64.rs b/compiler/rustc_target/src/callconv/powerpc64.rs index 6a8a6841781c9..3eb40abe90f33 100644 --- a/compiler/rustc_target/src/callconv/powerpc64.rs +++ b/compiler/rustc_target/src/callconv/powerpc64.rs @@ -2,7 +2,7 @@ // Alignment of 128 bit types is not currently handled, this will // need to be fixed when PowerPC vector support is added. -use rustc_abi::{Endian, HasDataLayout, TyAbiInterface}; +use rustc_abi::{HasDataLayout, TyAbiInterface}; use crate::callconv::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform}; use crate::spec::{HasTargetSpec, LlvmAbi, Os}; @@ -106,17 +106,13 @@ where Ty: TyAbiInterface<'a, C> + Copy, C: HasDataLayout + HasTargetSpec, { - let abi = if cx.target_spec().options.llvm_abiname == LlvmAbi::ElfV2 { - ELFv2 - } else if cx.target_spec().options.llvm_abiname == LlvmAbi::ElfV1 { - ELFv1 - } else if cx.target_spec().os == Os::Aix { - AIX - } else { - match cx.data_layout().endian { - Endian::Big => ELFv1, - Endian::Little => ELFv2, - } + let abi = match cx.target_spec().options.llvm_abiname { + LlvmAbi::ElfV1 => ELFv1, + LlvmAbi::ElfV2 => ELFv2, + LlvmAbi::Unspecified if cx.target_spec().os == Os::Aix => AIX, + // Target::check_consistency enforces that every target except AIX + // sets llvm_abiname to either ElfV1 or ElfV2 + _ => unreachable!(), }; classify(cx, &mut fn_abi.ret, abi, true);