Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions compiler/rustc_target/src/callconv/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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);
Expand Down
Loading