Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
use rustc_session::Session;
use rustc_session::config::OutputFilenames;
use rustc_span::{Symbol, sym};
use rustc_target::spec::{Abi, Arch, Env, Os};
use rustc_target::spec::{Arch, CfgAbi, Env, Os};

pub use crate::config::*;
use crate::prelude::*;
Expand Down Expand Up @@ -178,7 +178,7 @@ impl CodegenBackend for CraneliftCodegenBackend {
let has_reliable_f16_f128 = !(sess.target.arch == Arch::X86_64
&& sess.target.os == Os::Windows
&& sess.target.env == Env::Gnu
&& sess.target.abi != Abi::Llvm);
&& sess.target.cfg_abi != CfgAbi::Llvm);

// FIXME(f128): f128 math operations need f128 math symbols, which currently aren't always
// filled in by compiler-builtins. The only libc that provides these currently is glibc.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ pub(crate) fn target_machine_factory(
let triple = SmallCStr::new(&versioned_llvm_target(sess));
let cpu = SmallCStr::new(llvm_util::target_cpu(sess));
let features = CString::new(target_features.join(",")).unwrap();
let abi = SmallCStr::new(&sess.target.llvm_abiname);
let abi = SmallCStr::new(sess.target.llvm_abiname.desc());
let trap_unreachable =
sess.opts.unstable_opts.trap_unreachable.unwrap_or(sess.target.trap_unreachable);
let emit_stack_size_section = sess.opts.unstable_opts.emit_stack_sizes;
Expand Down
9 changes: 4 additions & 5 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use rustc_session::config::{
use rustc_span::{DUMMY_SP, Span, Spanned, Symbol};
use rustc_symbol_mangling::mangle_internal_symbol;
use rustc_target::spec::{
Abi, Arch, Env, HasTargetSpec, Os, RelocModel, SmallDataThresholdSupport, Target, TlsModel,
Arch, CfgAbi, Env, HasTargetSpec, Os, RelocModel, SmallDataThresholdSupport, Target, TlsModel,
};
use smallvec::SmallVec;

Expand Down Expand Up @@ -360,7 +360,7 @@ pub(crate) unsafe fn create_module<'ll>(
if sess.target.is_like_msvc
|| (sess.target.options.os == Os::Windows
&& sess.target.options.env == Env::Gnu
&& sess.target.options.abi == Abi::Llvm)
&& sess.target.options.cfg_abi == CfgAbi::Llvm)
{
match sess.opts.cg.control_flow_guard {
CFGuard::Disabled => {}
Expand Down Expand Up @@ -525,14 +525,13 @@ pub(crate) unsafe fn create_module<'ll>(
// to workaround lld as the LTO plugin not
// correctly setting target-abi for the LTO object
// FIXME: https://github.com/llvm/llvm-project/issues/50591
// If llvm_abiname is empty, emit nothing.
let llvm_abiname = &sess.target.options.llvm_abiname;
if matches!(sess.target.arch, Arch::RiscV32 | Arch::RiscV64) && !llvm_abiname.is_empty() {
if matches!(sess.target.arch, Arch::RiscV32 | Arch::RiscV64) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We force all riscv targets to set an ABI so no check for an empty ABI name is needed here.

llvm::add_module_flag_str(
llmod,
llvm::ModuleFlagMergeBehavior::Error,
"target-abi",
llvm_abiname,
llvm_abiname.desc(),
);
}

Expand Down
12 changes: 8 additions & 4 deletions compiler/rustc_codegen_llvm/src/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use rustc_middle::bug;
use rustc_session::Session;
use rustc_session::config::{PrintKind, PrintRequest};
use rustc_target::spec::{
Abi, Arch, Env, MergeFunctions, Os, PanicStrategy, SmallDataThresholdSupport,
Arch, CfgAbi, Env, MergeFunctions, Os, PanicStrategy, SmallDataThresholdSupport,
};
use smallvec::{SmallVec, smallvec};

Expand Down Expand Up @@ -366,7 +366,7 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
let target_arch = &sess.target.arch;
let target_os = &sess.target.options.os;
let target_env = &sess.target.options.env;
let target_abi = &sess.target.options.abi;
let target_abi = &sess.target.options.cfg_abi;
let target_pointer_width = sess.target.pointer_width;
let version = get_version();
let (major, _, _) = version;
Expand All @@ -384,7 +384,9 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
// Selection failure <https://github.com/llvm/llvm-project/issues/50374> (fixed in llvm21)
(Arch::S390x, _) if major < 21 => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
(Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != Abi::Llvm => false,
(Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != CfgAbi::Llvm => {
false
}
// Infinite recursion <https://github.com/llvm/llvm-project/issues/97981>
(Arch::CSky, _) if major < 22 => false, // (fixed in llvm22)
(Arch::Hexagon, _) if major < 21 => false, // (fixed in llvm21)
Expand Down Expand Up @@ -417,7 +419,9 @@ fn update_target_reliable_float_cfg(sess: &Session, cfg: &mut TargetConfig) {
// not fail if our compiler-builtins is linked. (fixed in llvm21)
(Arch::X86, _) if major < 21 => false,
// MinGW ABI bugs <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115054>
(Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != Abi::Llvm => false,
(Arch::X86_64, Os::Windows) if *target_env == Env::Gnu && *target_abi != CfgAbi::Llvm => {
false
}
// There are no known problems on other platforms, so the only requirement is that symbols
// are available. `compiler-builtins` provides all symbols required for core `f128`
// support, so this should work for everything else.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/va_arg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc_codegen_ssa::traits::{
use rustc_middle::bug;
use rustc_middle::ty::Ty;
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
use rustc_target::spec::{Arch, Env, RustcAbi};
use rustc_target::spec::{Arch, Env, LlvmAbi, RustcAbi};

use crate::builder::Builder;
use crate::llvm::{Type, Value};
Expand Down Expand Up @@ -1077,7 +1077,7 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
AllowHigherAlign::Yes,
ForceRightAdjust::Yes,
),
Arch::RiscV32 if target.llvm_abiname == "ilp32e" => {
Arch::RiscV32 if target.llvm_abiname == LlvmAbi::Ilp32e => {
// FIXME: clang manually adjusts the alignment for this ABI. It notes:
//
// > To be compatible with GCC's behaviors, we force arguments with
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use rustc_session::{Session, filesearch};
use rustc_span::Symbol;
use rustc_target::spec::crt_objects::CrtObjects;
use rustc_target::spec::{
Abi, BinaryFormat, Cc, Env, LinkOutputKind, LinkSelfContainedComponents,
BinaryFormat, Cc, CfgAbi, Env, LinkOutputKind, LinkSelfContainedComponents,
LinkSelfContainedDefault, LinkerFeatures, LinkerFlavor, LinkerFlavorCli, Lld, Os, RelocModel,
RelroLevel, SanitizerSet, SplitDebuginfo,
};
Expand Down Expand Up @@ -1917,7 +1917,7 @@ fn self_contained_components(
LinkSelfContainedDefault::InferredForMusl => sess.crt_static(Some(crate_type)),
LinkSelfContainedDefault::InferredForMingw => {
sess.host == sess.target
&& sess.target.abi != Abi::Uwp
&& sess.target.cfg_abi != CfgAbi::Uwp
&& detect_self_contained_mingw(sess, linker)
}
}
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_codegen_ssa/src/back/linker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use rustc_middle::middle::exported_symbols::{
use rustc_middle::ty::TyCtxt;
use rustc_session::Session;
use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip};
use rustc_target::spec::{Abi, Arch, Cc, LinkOutputKind, LinkerFlavor, Lld, Os};
use rustc_target::spec::{Arch, Cc, CfgAbi, LinkOutputKind, LinkerFlavor, Lld, Os};
use tracing::{debug, warn};

use super::command::Command;
Expand Down Expand Up @@ -84,7 +84,7 @@ pub(crate) fn get_linker<'a>(
// To comply with the Windows App Certification Kit,
// MSVC needs to link with the Store versions of the runtime libraries (vcruntime, msvcrt, etc).
let t = &sess.target;
if matches!(flavor, LinkerFlavor::Msvc(..)) && t.abi == Abi::Uwp {
if matches!(flavor, LinkerFlavor::Msvc(..)) && t.cfg_abi == CfgAbi::Uwp {
if let Some(ref tool) = msvc_tool {
let original_path = tool.path();
if let Some(root_lib_path) = original_path.ancestors().nth(4) {
Expand Down Expand Up @@ -135,7 +135,7 @@ pub(crate) fn get_linker<'a>(

// FIXME: Move `/LIBPATH` addition for uwp targets from the linker construction
// to the linker args construction.
assert!(cmd.get_args().is_empty() || sess.target.abi == Abi::Uwp);
assert!(cmd.get_args().is_empty() || sess.target.cfg_abi == CfgAbi::Uwp);
match flavor {
LinkerFlavor::Unix(Cc::No) if sess.target.os == Os::L4Re => {
Box::new(L4Bender::new(cmd, sess)) as Box<dyn Linker>
Expand Down
51 changes: 23 additions & 28 deletions compiler/rustc_codegen_ssa/src/back/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_metadata::fs::METADATA_FILENAME;
use rustc_middle::bug;
use rustc_session::Session;
use rustc_span::sym;
use rustc_target::spec::{Abi, Os, RelocModel, Target, ef_avr_arch};
use rustc_target::spec::{CfgAbi, LlvmAbi, Os, RelocModel, Target, ef_avr_arch};
use tracing::debug;

use super::apple;
Expand Down Expand Up @@ -294,18 +294,13 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
_ => elf::EF_MIPS_ARCH_64R2,
};

// If the ABI is explicitly given, use it, or default to O32 on 32-bit MIPS,
// which is the only "true" 32-bit option that LLVM supports.
match sess.target.options.llvm_abiname.as_ref() {
"o32" if is_32bit => e_flags |= elf::EF_MIPS_ABI_O32,
"n32" if !is_32bit => e_flags |= elf::EF_MIPS_ABI2,
"n64" if !is_32bit => {}
"" if is_32bit => e_flags |= elf::EF_MIPS_ABI_O32,
"" => sess.dcx().fatal("LLVM ABI must be specified for 64-bit MIPS targets"),
s if is_32bit => {
sess.dcx().fatal(format!("invalid LLVM ABI `{}` for 32-bit MIPS target", s))
}
s => sess.dcx().fatal(format!("invalid LLVM ABI `{}` for 64-bit MIPS target", s)),
// Use the explicitly given ABI.
match &sess.target.options.llvm_abiname {
LlvmAbi::O32 if is_32bit => e_flags |= elf::EF_MIPS_ABI_O32,
LlvmAbi::N32 if !is_32bit => e_flags |= elf::EF_MIPS_ABI2,
LlvmAbi::N64 if !is_32bit => {}
// The rest is invalid (which is already ensured by the target spec check).
s => bug!("invalid LLVM ABI `{}` for MIPS target", s),
};

if sess.target.options.relocation_model != RelocModel::Static {
Expand Down Expand Up @@ -341,12 +336,12 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {

// Set the appropriate flag based on ABI
// This needs to match LLVM `RISCVELFStreamer.cpp`
match &*sess.target.llvm_abiname {
"ilp32" | "lp64" => (),
"ilp32f" | "lp64f" => e_flags |= elf::EF_RISCV_FLOAT_ABI_SINGLE,
"ilp32d" | "lp64d" => e_flags |= elf::EF_RISCV_FLOAT_ABI_DOUBLE,
match &sess.target.llvm_abiname {
LlvmAbi::Ilp32 | LlvmAbi::Lp64 => (),
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => e_flags |= elf::EF_RISCV_FLOAT_ABI_SINGLE,
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => e_flags |= elf::EF_RISCV_FLOAT_ABI_DOUBLE,
// Note that the `lp64e` is still unstable as it's not (yet) part of the ELF psABI.
"ilp32e" | "lp64e" => e_flags |= elf::EF_RISCV_RVE,
LlvmAbi::Ilp32e | LlvmAbi::Lp64e => e_flags |= elf::EF_RISCV_RVE,
_ => bug!("unknown RISC-V ABI name"),
}

Expand All @@ -358,10 +353,10 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {

// Set the appropriate flag based on ABI
// This needs to match LLVM `LoongArchELFStreamer.cpp`
match &*sess.target.llvm_abiname {
"ilp32s" | "lp64s" => e_flags |= elf::EF_LARCH_ABI_SOFT_FLOAT,
"ilp32f" | "lp64f" => e_flags |= elf::EF_LARCH_ABI_SINGLE_FLOAT,
"ilp32d" | "lp64d" => e_flags |= elf::EF_LARCH_ABI_DOUBLE_FLOAT,
match &sess.target.llvm_abiname {
LlvmAbi::Ilp32s | LlvmAbi::Lp64s => e_flags |= elf::EF_LARCH_ABI_SOFT_FLOAT,
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => e_flags |= elf::EF_LARCH_ABI_SINGLE_FLOAT,
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => e_flags |= elf::EF_LARCH_ABI_DOUBLE_FLOAT,
_ => bug!("unknown LoongArch ABI name"),
}

Expand All @@ -377,7 +372,7 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
}
}
Architecture::Csky => {
if matches!(sess.target.options.abi, Abi::AbiV2) {
if matches!(sess.target.options.cfg_abi, CfgAbi::AbiV2) {
elf::EF_CSKY_ABIV2
} else {
elf::EF_CSKY_ABIV1
Expand All @@ -388,14 +383,14 @@ pub(super) fn elf_e_flags(architecture: Architecture, sess: &Session) -> u32 {
const EF_PPC64_ABI_ELF_V1: u32 = 1;
const EF_PPC64_ABI_ELF_V2: u32 = 2;

match sess.target.options.llvm_abiname.as_ref() {
match sess.target.options.llvm_abiname {
// If the flags do not correctly indicate the ABI,
// linkers such as ld.lld assume that the ppc64 object files are always ELFv2
// which leads to broken binaries if ELFv1 is used for the object files.
"elfv1" => EF_PPC64_ABI_ELF_V1,
"elfv2" => EF_PPC64_ABI_ELF_V2,
"" if sess.target.options.binary_format.to_object() == BinaryFormat::Elf => {
bug!("No ABI specified for this PPC64 ELF target");
LlvmAbi::ElfV1 => EF_PPC64_ABI_ELF_V1,
LlvmAbi::ElfV2 => EF_PPC64_ABI_ELF_V2,
_ if sess.target.options.binary_format.to_object() == BinaryFormat::Elf => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ElfV1 and ElfV2 are the only allowed ABI names here so we can error on everything else.

bug!("invalid ABI specified for this PPC64 ELF target");
}
// Fall back
_ => EF_PPC64_ABI_UNKNOWN,
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc_middle::ty::{self, Instance, TyCtxt};
use rustc_middle::{bug, mir, span_bug};
use rustc_session::cstore::{DllCallingConvention, DllImport};
use rustc_span::Span;
use rustc_target::spec::{Abi, Env, Os, Target};
use rustc_target::spec::{CfgAbi, Env, Os, Target};

use crate::traits::*;

Expand Down Expand Up @@ -171,7 +171,7 @@ pub fn asm_const_to_str<'tcx>(
}

pub fn is_mingw_gnu_toolchain(target: &Target) -> bool {
target.os == Os::Windows && target.env == Env::Gnu && target.abi == Abi::Unspecified
target.os == Os::Windows && target.env == Env::Gnu && target.cfg_abi == CfgAbi::Unspecified
}

pub fn i686_decorated_name(
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_metadata/src/native_libs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rustc_session::cstore::{DllCallingConvention, DllImport, ForeignModule, Nati
use rustc_session::search_paths::PathKind;
use rustc_span::Symbol;
use rustc_span::def_id::{DefId, LOCAL_CRATE};
use rustc_target::spec::{Abi, Arch, BinaryFormat, Env, LinkSelfContainedComponents, Os};
use rustc_target::spec::{Arch, BinaryFormat, CfgAbi, Env, LinkSelfContainedComponents, Os};

use crate::errors;

Expand Down Expand Up @@ -68,14 +68,14 @@ pub fn walk_native_lib_search_dirs<R>(
// FIXME: On AIX this also has the side-effect of making the list of library search paths
// non-empty, which is needed or the linker may decide to record the LIBPATH env, if
// defined, as the search path instead of appending the default search paths.
if sess.target.abi == Abi::Fortanix
if sess.target.cfg_abi == CfgAbi::Fortanix
|| sess.target.os == Os::Linux
|| sess.target.os == Os::Fuchsia
|| sess.target.is_like_aix
|| sess.target.is_like_darwin && !sess.sanitizers().is_empty()
|| sess.target.os == Os::Windows
&& sess.target.env == Env::Gnu
&& sess.target.abi == Abi::Llvm
&& sess.target.cfg_abi == CfgAbi::Llvm
{
f(&sess.target_tlib_path.dir, false)?;
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_session/src/config/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub(crate) fn default_configuration(sess: &Session) -> Cfg {
ins_none!(sym::sanitizer_cfi_normalize_integers);
}

ins_sym!(sym::target_abi, sess.target.abi.desc_symbol());
ins_sym!(sym::target_abi, sess.target.cfg_abi.desc_symbol());
ins_sym!(sym::target_arch, sess.target.arch.desc_symbol());
ins_str!(sym::target_endian, sess.target.endian.as_str());
ins_sym!(sym::target_env, sess.target.env.desc_symbol());
Expand Down Expand Up @@ -447,7 +447,7 @@ impl CheckCfg {
};

for target in Target::builtins().chain(iter::once(current_target.clone())) {
values_target_abi.insert(target.options.abi.desc_symbol());
values_target_abi.insert(target.options.cfg_abi.desc_symbol());
values_target_arch.insert(target.arch.desc_symbol());
values_target_endian.insert(Symbol::intern(target.options.endian.as_str()));
values_target_env.insert(target.options.env.desc_symbol());
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_target/src/asm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
use rustc_span::Symbol;

use crate::spec::{Abi, Arch, RelocModel, Target};
use crate::spec::{Arch, CfgAbi, RelocModel, Target};

pub struct ModifierInfo {
pub modifier: char,
Expand Down Expand Up @@ -1001,7 +1001,7 @@ impl InlineAsmClobberAbi {
_ => Err(&["C", "system", "efiapi"]),
},
InlineAsmArch::PowerPC | InlineAsmArch::PowerPC64 => match name {
"C" | "system" => Ok(if target.abi == Abi::Spe {
"C" | "system" => Ok(if target.cfg_abi == CfgAbi::Spe {
InlineAsmClobberAbi::PowerPCSPE
} else {
InlineAsmClobberAbi::PowerPC
Expand Down
14 changes: 9 additions & 5 deletions compiler/rustc_target/src/asm/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc_data_structures::fx::FxIndexSet;
use rustc_span::Symbol;

use super::{InlineAsmArch, InlineAsmType, ModifierInfo};
use crate::spec::{Abi, RelocModel, Target};
use crate::spec::{CfgAbi, RelocModel, Target};

def_reg_class! {
PowerPC PowerPCInlineAsmRegClass {
Expand Down Expand Up @@ -105,9 +105,9 @@ fn reserved_v20to31(
_is_clobber: bool,
) -> Result<(), &'static str> {
if target.is_like_aix {
match &target.options.abi {
Abi::VecDefault => Err("v20-v31 (vs52-vs63) are reserved on vec-default ABI"),
Abi::VecExtAbi => Ok(()),
match &target.options.cfg_abi {
CfgAbi::VecDefault => Err("v20-v31 (vs52-vs63) are reserved on vec-default ABI"),
CfgAbi::VecExtAbi => Ok(()),
abi => unreachable!("unrecognized AIX ABI: {abi}"),
}
} else {
Expand All @@ -122,7 +122,11 @@ fn spe_acc_target_check(
target: &Target,
_is_clobber: bool,
) -> Result<(), &'static str> {
if target.abi == Abi::Spe { Ok(()) } else { Err("spe_acc is only available on spe targets") }
if target.cfg_abi == CfgAbi::Spe {
Ok(())
} else {
Err("spe_acc is only available on spe targets")
}
}

def_regs! {
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_target/src/callconv/loongarch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc_abi::{
};

use crate::callconv::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Uniform};
use crate::spec::HasTargetSpec;
use crate::spec::{HasTargetSpec, LlvmAbi};

#[derive(Copy, Clone)]
enum RegPassKind {
Expand Down Expand Up @@ -415,9 +415,9 @@ where
C: HasDataLayout + HasTargetSpec,
{
let xlen = cx.data_layout().pointer_size().bits();
let flen = match &cx.target_spec().llvm_abiname[..] {
"ilp32f" | "lp64f" => 32,
"ilp32d" | "lp64d" => 64,
let flen = match &cx.target_spec().llvm_abiname {
LlvmAbi::Ilp32f | LlvmAbi::Lp64f => 32,
LlvmAbi::Ilp32d | LlvmAbi::Lp64d => 64,
_ => 0,
};

Expand Down
Loading
Loading