Skip to content

Commit a3237e2

Browse files
committed
rustc_target: callconv: powerpc64: Use llvm_abiname rather than target_abi for ABI determination
Currently on PowerPC64 targets, llvm_abiname and target_abi will be the same unless we're on AIX. Since llvm_abiname is what we pass on to LLVM, it is preferable to use the value of that to determine the calling convention rather than target_abi. All PowerPC64 targets set both llvm_abiname and target_abi to the respective ELF ABIs, with the exception of AIX. This is a non-functional change.
1 parent eeb94be commit a3237e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_target/src/callconv/powerpc64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ where
106106
Ty: TyAbiInterface<'a, C> + Copy,
107107
C: HasDataLayout + HasTargetSpec,
108108
{
109-
let abi = if cx.target_spec().options.abi == Abi::ElfV2 {
109+
let abi = if cx.target_spec().options.llvm_abiname == "elfv2" {
110110
ELFv2
111-
} else if cx.target_spec().options.abi == Abi::ElfV1 {
111+
} else if cx.target_spec().options.llvm_abiname == "elfv1" {
112112
ELFv1
113113
} else if cx.target_spec().os == Os::Aix {
114114
AIX

0 commit comments

Comments
 (0)