Skip to content

Commit e1c03d7

Browse files
committed
rename rust_abi → rustc_abi
1 parent 7a454cc commit e1c03d7

27 files changed

+72
-72
lines changed

compiler/rustc_target/src/callconv/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::abi::{
1010
TyAndLayout,
1111
};
1212
use crate::spec::abi::Abi as SpecAbi;
13-
use crate::spec::{self, HasTargetSpec, HasWasmCAbiOpt, HasX86AbiOpt, RustAbi, WasmCAbi};
13+
use crate::spec::{self, HasTargetSpec, HasWasmCAbiOpt, HasX86AbiOpt, RustcAbi, WasmCAbi};
1414

1515
mod aarch64;
1616
mod amdgpu;
@@ -755,8 +755,8 @@ impl<'a, Ty> FnAbi<'a, Ty> {
755755
let can_pass_simd_directly = |arg: &ArgAbi<'_, Ty>| match &*spec.arch {
756756
// On x86, if we have SSE2 (which we have by default for x86_64), we can always pass up
757757
// to 128-bit-sized vectors.
758-
"x86" if spec.rust_abi == Some(RustAbi::X86Sse2) => arg.layout.size.bits() <= 128,
759-
"x86_64" if spec.rust_abi != Some(RustAbi::X86Softfloat) => {
758+
"x86" if spec.rustc_abi == Some(RustcAbi::X86Sse2) => arg.layout.size.bits() <= 128,
759+
"x86_64" if spec.rustc_abi != Some(RustcAbi::X86Softfloat) => {
760760
arg.layout.size.bits() <= 128
761761
}
762762
// So far, we haven't implemented this logic for any other target.

compiler/rustc_target/src/callconv/x86.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::abi::{
33
AddressSpace, Align, BackendRepr, Float, HasDataLayout, Pointer, TyAbiInterface, TyAndLayout,
44
};
55
use crate::spec::abi::Abi as SpecAbi;
6-
use crate::spec::{HasTargetSpec, RustAbi};
6+
use crate::spec::{HasTargetSpec, RustcAbi};
77

88
#[derive(PartialEq)]
99
pub(crate) enum Flavor {
@@ -234,7 +234,7 @@ where
234234
_ => false, // anyway not passed via registers on x86
235235
};
236236
if has_float {
237-
if cx.target_spec().rust_abi == Some(RustAbi::X86Sse2)
237+
if cx.target_spec().rustc_abi == Some(RustcAbi::X86Sse2)
238238
&& fn_abi.ret.layout.backend_repr.is_scalar()
239239
&& fn_abi.ret.layout.size.bits() <= 128
240240
{

compiler/rustc_target/src/spec/base/apple/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::borrow::Cow;
22
use std::env;
33

44
use crate::spec::{
5-
Cc, DebuginfoKind, FloatAbi, FramePointer, LinkerFlavor, Lld, RustAbi, SplitDebuginfo,
5+
Cc, DebuginfoKind, FloatAbi, FramePointer, LinkerFlavor, Lld, RustcAbi, SplitDebuginfo,
66
StackProbeType, StaticCow, TargetOptions, cvs,
77
};
88

@@ -156,7 +156,7 @@ pub(crate) fn base(
156156
};
157157
if matches!(arch, Arch::I386 | Arch::I686) {
158158
// All Apple x86-32 targets have SSE2.
159-
opts.rust_abi = Some(RustAbi::X86Sse2);
159+
opts.rustc_abi = Some(RustcAbi::X86Sse2);
160160
}
161161
(opts, unversioned_llvm_target(os, arch, abi), arch.target_arch())
162162
}

compiler/rustc_target/src/spec/json.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ impl Target {
128128
Some(Ok(()))
129129
})).unwrap_or(Ok(()))
130130
} );
131-
($key_name:ident, RustAbi) => ( {
131+
($key_name:ident, RustcAbi) => ( {
132132
let name = (stringify!($key_name)).replace("_", "-");
133133
obj.remove(&name).and_then(|o| o.as_str().and_then(|s| {
134-
match s.parse::<super::RustAbi>() {
135-
Ok(rust_abi) => base.$key_name = Some(rust_abi),
134+
match s.parse::<super::RustcAbi>() {
135+
Ok(rustc_abi) => base.$key_name = Some(rustc_abi),
136136
_ => return Some(Err(format!(
137137
"'{s}' is not a valid value for rust-abi. \
138138
Use 'x86-softfloat' or 'x86-sse2'."
@@ -624,7 +624,7 @@ impl Target {
624624
key!(llvm_mcount_intrinsic, optional);
625625
key!(llvm_abiname);
626626
key!(llvm_floatabi, FloatAbi)?;
627-
key!(rust_abi, RustAbi)?;
627+
key!(rustc_abi, RustcAbi)?;
628628
key!(relax_elf_relocations, bool);
629629
key!(llvm_args, list);
630630
key!(use_ctors_section, bool);
@@ -800,7 +800,7 @@ impl ToJson for Target {
800800
target_option_val!(llvm_mcount_intrinsic);
801801
target_option_val!(llvm_abiname);
802802
target_option_val!(llvm_floatabi);
803-
target_option_val!(rust_abi);
803+
target_option_val!(rustc_abi);
804804
target_option_val!(relax_elf_relocations);
805805
target_option_val!(llvm_args);
806806
target_option_val!(use_ctors_section);

compiler/rustc_target/src/spec/mod.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,32 +1114,32 @@ impl ToJson for FloatAbi {
11141114
}
11151115
}
11161116

1117-
/// The Rust-specific variant of the ABI used for this target.
1117+
/// The Rustc-specific variant of the ABI used for this target.
11181118
#[derive(Clone, Copy, PartialEq, Hash, Debug)]
1119-
pub enum RustAbi {
1119+
pub enum RustcAbi {
11201120
/// On x86-32 only: make use of SSE and SSE2 for ABI purposes.
11211121
X86Sse2,
11221122
/// On x86-32/64 only: do not use any FPU or SIMD registers for the ABI/
11231123
X86Softfloat,
11241124
}
11251125

1126-
impl FromStr for RustAbi {
1126+
impl FromStr for RustcAbi {
11271127
type Err = ();
11281128

1129-
fn from_str(s: &str) -> Result<RustAbi, ()> {
1129+
fn from_str(s: &str) -> Result<RustcAbi, ()> {
11301130
Ok(match s {
1131-
"x86-sse2" => RustAbi::X86Sse2,
1132-
"x86-softfloat" => RustAbi::X86Softfloat,
1131+
"x86-sse2" => RustcAbi::X86Sse2,
1132+
"x86-softfloat" => RustcAbi::X86Softfloat,
11331133
_ => return Err(()),
11341134
})
11351135
}
11361136
}
11371137

1138-
impl ToJson for RustAbi {
1138+
impl ToJson for RustcAbi {
11391139
fn to_json(&self) -> Json {
11401140
match *self {
1141-
RustAbi::X86Sse2 => "x86-sse2",
1142-
RustAbi::X86Softfloat => "x86-softfloat",
1141+
RustcAbi::X86Sse2 => "x86-sse2",
1142+
RustcAbi::X86Softfloat => "x86-softfloat",
11431143
}
11441144
.to_json()
11451145
}
@@ -2528,7 +2528,7 @@ pub struct TargetOptions {
25282528
/// it can also affect "C" ABI functions; the point is that this flag is interpreted by
25292529
/// rustc and not forwarded to LLVM.
25302530
/// So far, this is only used on x86.
2531-
pub rust_abi: Option<RustAbi>,
2531+
pub rustc_abi: Option<RustcAbi>,
25322532

25332533
/// Whether or not RelaxElfRelocation flag will be passed to the linker
25342534
pub relax_elf_relocations: bool,
@@ -2794,7 +2794,7 @@ impl Default for TargetOptions {
27942794
llvm_mcount_intrinsic: None,
27952795
llvm_abiname: "".into(),
27962796
llvm_floatabi: None,
2797-
rust_abi: None,
2797+
rustc_abi: None,
27982798
relax_elf_relocations: false,
27992799
llvm_args: cvs![],
28002800
use_ctors_section: false,
@@ -3256,14 +3256,14 @@ impl Target {
32563256
}
32573257

32583258
// Check consistency of Rust ABI declaration.
3259-
if let Some(rust_abi) = self.rust_abi {
3259+
if let Some(rust_abi) = self.rustc_abi {
32603260
match rust_abi {
3261-
RustAbi::X86Sse2 => check_matches!(
3261+
RustcAbi::X86Sse2 => check_matches!(
32623262
&*self.arch,
32633263
"x86",
32643264
"`x86-sse2` ABI is only valid for x86-32 targets"
32653265
),
3266-
RustAbi::X86Softfloat => check_matches!(
3266+
RustcAbi::X86Softfloat => check_matches!(
32673267
&*self.arch,
32683268
"x86" | "x86_64",
32693269
"`x86-softfloat` ABI is only valid for x86 targets"

compiler/rustc_target/src/spec/targets/i586_pc_nto_qnx700.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{Cc, LinkerFlavor, Lld, RustAbi, StackProbeType, Target, TargetOptions, base};
1+
use crate::spec::{Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target, TargetOptions, base};
22

33
pub(crate) fn target() -> Target {
44
Target {
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515
.into(),
1616
arch: "x86".into(),
1717
options: TargetOptions {
18-
rust_abi: Some(RustAbi::X86Sse2),
18+
rustc_abi: Some(RustcAbi::X86Sse2),
1919
cpu: "pentium4".into(),
2020
max_atomic_width: Some(64),
2121
pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[

compiler/rustc_target/src/spec/targets/i586_unknown_linux_gnu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::spec::Target;
22

33
pub(crate) fn target() -> Target {
44
let mut base = super::i686_unknown_linux_gnu::target();
5-
base.rust_abi = None;
5+
base.rustc_abi = None;
66
base.cpu = "pentium".into();
77
base.llvm_target = "i586-unknown-linux-gnu".into();
88
base

compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::spec::Target;
22

33
pub(crate) fn target() -> Target {
44
let mut base = super::i686_unknown_linux_musl::target();
5-
base.rust_abi = None;
5+
base.rustc_abi = None;
66
base.cpu = "pentium".into();
77
base.llvm_target = "i586-unknown-linux-musl".into();
88
// FIXME(compiler-team#422): musl targets should be dynamically linked by default.

compiler/rustc_target/src/spec/targets/i686_linux_android.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::spec::{RustAbi, SanitizerSet, StackProbeType, Target, TargetOptions, base};
1+
use crate::spec::{RustcAbi, SanitizerSet, StackProbeType, Target, TargetOptions, base};
22

33
// See https://developer.android.com/ndk/guides/abis.html#x86
44
// for target ABI requirements.
@@ -8,7 +8,7 @@ pub(crate) fn target() -> Target {
88

99
base.max_atomic_width = Some(64);
1010

11-
base.rust_abi = Some(RustAbi::X86Sse2);
11+
base.rustc_abi = Some(RustcAbi::X86Sse2);
1212
// https://developer.android.com/ndk/guides/abis.html#x86
1313
base.cpu = "pentiumpro".into();
1414
base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".into();

compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, RustAbi, Target, base};
1+
use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target, base};
22

33
pub(crate) fn target() -> Target {
44
let mut base = base::windows_gnu::opts();
5-
base.rust_abi = Some(RustAbi::X86Sse2);
5+
base.rustc_abi = Some(RustcAbi::X86Sse2);
66
base.cpu = "pentium4".into();
77
base.max_atomic_width = Some(64);
88
base.frame_pointer = FramePointer::Always; // Required for backtraces

0 commit comments

Comments
 (0)