Skip to content

Commit d501f96

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 d501f96

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

compiler/rustc_target/src/callconv/powerpc64.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use rustc_abi::{Endian, HasDataLayout, TyAbiInterface};
66

77
use crate::callconv::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform};
8-
use crate::spec::{Abi, HasTargetSpec, Os};
8+
use crate::spec::{HasTargetSpec, Os};
99

1010
#[derive(Debug, Clone, Copy, PartialEq)]
1111
enum ABI {
@@ -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)