1
Fork 0

compiler: remove rustc_target::abi entirely

This commit is contained in:
Jubilee Young 2025-02-04 22:06:41 -08:00
parent 3948be651a
commit 1f37b9a643
80 changed files with 129 additions and 87 deletions

View file

@ -2,7 +2,7 @@ use std::iter;
use rustc_abi::{BackendRepr, HasDataLayout, Primitive, TyAbiInterface};
use crate::abi::call::{ArgAbi, FnAbi, Reg, RegKind, Uniform};
use crate::callconv::{ArgAbi, FnAbi, Reg, RegKind, Uniform};
use crate::spec::{HasTargetSpec, Target};
/// Indicates the variant of the AArch64 ABI we are compiling for.

View file

@ -1,6 +1,6 @@
use rustc_abi::{HasDataLayout, TyAbiInterface};
use crate::abi::call::{ArgAbi, FnAbi};
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret<'a, Ty, C>(_cx: &C, ret: &mut ArgAbi<'a, Ty>)
where

View file

@ -1,6 +1,6 @@
use rustc_abi::{HasDataLayout, TyAbiInterface};
use crate::abi::call::{ArgAbi, Conv, FnAbi, Reg, RegKind, Uniform};
use crate::callconv::{ArgAbi, Conv, FnAbi, Reg, RegKind, Uniform};
use crate::spec::HasTargetSpec;
fn is_homogeneous_aggregate<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>) -> Option<Uniform>

View file

@ -30,7 +30,7 @@
//! compatible with AVR-GCC - Rust and AVR-GCC only differ in the small amount
//! of compiler frontend specific calling convention logic implemented here.
use crate::abi::call::{ArgAbi, FnAbi};
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret_ty<Ty>(ret: &mut ArgAbi<'_, Ty>) {
if ret.layout.is_aggregate() {

View file

@ -1,5 +1,5 @@
// see https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/BPF/BPFCallingConv.td
use crate::abi::call::{ArgAbi, FnAbi};
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
if ret.layout.is_aggregate() || ret.layout.size.bits() > 64 {

View file

@ -4,7 +4,7 @@
// Reference: Clang CSKY lowering code
// https://github.com/llvm/llvm-project/blob/4a074f32a6914f2a8d7215d78758c24942dddc3d/clang/lib/CodeGen/Targets/CSKY.cpp#L76-L162
use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform};
use crate::callconv::{ArgAbi, FnAbi, Reg, Uniform};
fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>) {
if !arg.layout.is_sized() {

View file

@ -1,4 +1,4 @@
use crate::abi::call::{ArgAbi, FnAbi};
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
if ret.layout.is_aggregate() && ret.layout.size.bits() > 64 {

View file

@ -1,4 +1,4 @@
use crate::abi::call::{ArgAbi, FnAbi};
use crate::callconv::{ArgAbi, FnAbi};
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
if ret.layout.is_aggregate() {

View file

@ -1,6 +1,6 @@
use rustc_abi::{HasDataLayout, Size};
use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform};
use crate::callconv::{ArgAbi, FnAbi, Reg, Uniform};
fn classify_ret<Ty, C>(cx: &C, ret: &mut ArgAbi<'_, Ty>, offset: &mut Size)
where

View file

@ -1,7 +1,7 @@
// Reference: MSP430 Embedded Application Binary Interface
// https://www.ti.com/lit/an/slaa534a/slaa534a.pdf
use crate::abi::call::{ArgAbi, FnAbi};
use crate::callconv::{ArgAbi, FnAbi};
// 3.5 Structures or Unions Passed and Returned by Reference
//

View file

@ -1,7 +1,7 @@
use rustc_abi::{HasDataLayout, Reg, Size, TyAbiInterface};
use super::{ArgAttribute, ArgAttributes, ArgExtension, CastTarget};
use crate::abi::call::{ArgAbi, FnAbi, Uniform};
use crate::callconv::{ArgAbi, FnAbi, Uniform};
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
if ret.layout.is_aggregate() && ret.layout.is_sized() {

View file

@ -1,4 +1,4 @@
use crate::abi::call::{ArgAbi, FnAbi};
use crate::callconv::{ArgAbi, FnAbi};
use crate::spec::HasTargetSpec;
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {

View file

@ -4,7 +4,7 @@
use rustc_abi::{Endian, HasDataLayout, TyAbiInterface};
use crate::abi::call::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform};
use crate::callconv::{Align, ArgAbi, FnAbi, Reg, RegKind, Uniform};
use crate::spec::HasTargetSpec;
#[derive(Debug, Clone, Copy, PartialEq)]

View file

@ -9,7 +9,7 @@ use rustc_abi::{
TyAbiInterface, TyAndLayout, Variants,
};
use crate::abi::call::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Uniform};
use crate::callconv::{ArgAbi, ArgExtension, CastTarget, FnAbi, PassMode, Uniform};
use crate::spec::HasTargetSpec;
#[derive(Copy, Clone)]

View file

@ -3,7 +3,7 @@
use rustc_abi::{BackendRepr, HasDataLayout, TyAbiInterface};
use crate::abi::call::{ArgAbi, FnAbi, Reg, RegKind};
use crate::callconv::{ArgAbi, FnAbi, Reg, RegKind};
use crate::spec::HasTargetSpec;
fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {

View file

@ -1,6 +1,6 @@
use rustc_abi::{HasDataLayout, Size};
use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform};
use crate::callconv::{ArgAbi, FnAbi, Reg, Uniform};
fn classify_ret<Ty, C>(cx: &C, ret: &mut ArgAbi<'_, Ty>, offset: &mut Size)
where

View file

@ -5,7 +5,7 @@ use rustc_abi::{
TyAndLayout,
};
use crate::abi::call::{
use crate::callconv::{
ArgAbi, ArgAttribute, ArgAttributes, ArgExtension, CastTarget, FnAbi, Uniform,
};
use crate::spec::HasTargetSpec;

View file

@ -1,6 +1,6 @@
use rustc_abi::{BackendRepr, Float, HasDataLayout, Integer, Primitive, TyAbiInterface};
use crate::abi::call::{ArgAbi, FnAbi};
use crate::callconv::{ArgAbi, FnAbi};
fn unwrap_trivial_aggregate<'a, Ty, C>(cx: &C, val: &mut ArgAbi<'a, Ty>) -> bool
where

View file

@ -3,7 +3,7 @@ use rustc_abi::{
TyAbiInterface, TyAndLayout,
};
use crate::abi::call::{ArgAttribute, FnAbi, PassMode};
use crate::callconv::{ArgAttribute, FnAbi, PassMode};
use crate::spec::HasTargetSpec;
#[derive(PartialEq)]

View file

@ -6,7 +6,7 @@ use rustc_abi::{
Variants,
};
use crate::abi::call::{ArgAbi, CastTarget, FnAbi};
use crate::callconv::{ArgAbi, CastTarget, FnAbi};
/// Classification of "eightbyte" components.
// N.B., the order of the variants is from general to specific,

View file

@ -1,6 +1,6 @@
use rustc_abi::{BackendRepr, Float, Integer, Primitive, RegKind, Size};
use crate::abi::call::{ArgAbi, FnAbi, Reg};
use crate::callconv::{ArgAbi, FnAbi, Reg};
use crate::spec::HasTargetSpec;
// Win64 ABI: https://docs.microsoft.com/en-us/cpp/build/parameter-passing

View file

@ -7,7 +7,7 @@
use rustc_abi::{BackendRepr, HasDataLayout, Size, TyAbiInterface};
use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform};
use crate::callconv::{ArgAbi, FnAbi, Reg, Uniform};
use crate::spec::HasTargetSpec;
const NUM_ARG_GPRS: u64 = 6;

View file

@ -92,7 +92,7 @@ impl<A: ToJson> ToJson for Option<A> {
}
}
impl ToJson for crate::abi::call::Conv {
impl ToJson for crate::callconv::Conv {
fn to_json(&self) -> Json {
let buf: String;
let s = match self {

View file

@ -30,12 +30,6 @@ pub mod target_features;
#[cfg(test)]
mod tests;
pub mod abi {
pub use rustc_abi::*;
pub use crate::callconv as call;
}
pub use rustc_abi::HashStableContext;
/// The name of rustc's own place to organize libraries.

View file

@ -51,7 +51,7 @@ use rustc_span::{Symbol, kw, sym};
use serde_json::Value;
use tracing::debug;
use crate::abi::call::Conv;
use crate::callconv::Conv;
use crate::json::{Json, ToJson};
use crate::spec::crt_objects::CrtObjects;

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{FloatAbi, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,6 +1,7 @@
// Targets the Big endian Cortex-R4/R5 processor (ARMv7-R)
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{
Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions,
};

View file

@ -1,6 +1,7 @@
// Targets the Cortex-R4F/R5F processor (ARMv7-R)
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{
Cc, FloatAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions,
};

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, FloatAbi, LinkerFlavor, Lld, RelocModel, Target, TargetOptions, cvs};
/// A base target for PlayStation Vita devices using the VITASDK toolchain (using newlib).

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{LinkSelfContainedDefault, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{CodeModel, PanicStrategy, RelocModel, Target, TargetOptions};
pub(crate) fn target() -> Target {

View file

@ -1,6 +1,7 @@
//! A target tuple for OpenWrt MIPS64 targets.
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{StackProbeType, Target, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{SanitizerSet, StackProbeType, Target, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{SanitizerSet, StackProbeType, Target, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Target, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, Target, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::{Cc, LinkerFlavor, Target, base};
pub(crate) fn target() -> Target {

View file

@ -5,7 +5,7 @@
// The win64 ABI is used. It differs from the sysv64 ABI, so we must use a windows target with
// LLVM. "x86_64-unknown-windows" is used to get the minimal subset of windows-specific features.
use crate::abi::call::Conv;
use crate::callconv::Conv;
use crate::spec::{RustcAbi, Target, base};
pub(crate) fn target() -> Target {

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::base::xtensa;
use crate::spec::{Target, TargetOptions, cvs};

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::base::xtensa;
use crate::spec::{Target, TargetOptions, cvs};

View file

@ -1,4 +1,5 @@
use crate::abi::Endian;
use rustc_abi::Endian;
use crate::spec::base::xtensa;
use crate::spec::{Target, TargetOptions, cvs};