From 6c16a3123b2078d35dd726342d5df7e6763ffdbb Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 2 Nov 2024 19:33:04 -0700 Subject: [PATCH] compiler: Directly use rustc_abi in smir again --- .../rustc_smir/src/rustc_internal/internal.rs | 58 +++++++++---------- compiler/rustc_smir/src/rustc_smir/context.rs | 2 +- .../rustc_smir/src/rustc_smir/convert/mod.rs | 2 +- .../rustc_smir/src/rustc_smir/convert/ty.rs | 54 ++++++++--------- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/compiler/rustc_smir/src/rustc_internal/internal.rs b/compiler/rustc_smir/src/rustc_internal/internal.rs index 7be7db1fd3d..655553de864 100644 --- a/compiler/rustc_smir/src/rustc_internal/internal.rs +++ b/compiler/rustc_smir/src/rustc_internal/internal.rs @@ -237,10 +237,10 @@ impl RustcInternal for FnSig { } impl RustcInternal for VariantIdx { - type T<'tcx> = rustc_target::abi::VariantIdx; + type T<'tcx> = rustc_abi::VariantIdx; fn internal<'tcx>(&self, _tables: &mut Tables<'_>, _tcx: TyCtxt<'tcx>) -> Self::T<'tcx> { - rustc_target::abi::VariantIdx::from(self.to_index()) + rustc_abi::VariantIdx::from(self.to_index()) } } @@ -451,35 +451,35 @@ impl RustcInternal for AdtDef { } impl RustcInternal for Abi { - type T<'tcx> = rustc_target::spec::abi::Abi; + type T<'tcx> = rustc_abi::ExternAbi; fn internal<'tcx>(&self, _tables: &mut Tables<'_>, _tcx: TyCtxt<'tcx>) -> Self::T<'tcx> { match *self { - Abi::Rust => rustc_target::spec::abi::Abi::Rust, - Abi::C { unwind } => rustc_target::spec::abi::Abi::C { unwind }, - Abi::Cdecl { unwind } => rustc_target::spec::abi::Abi::Cdecl { unwind }, - Abi::Stdcall { unwind } => rustc_target::spec::abi::Abi::Stdcall { unwind }, - Abi::Fastcall { unwind } => rustc_target::spec::abi::Abi::Fastcall { unwind }, - Abi::Vectorcall { unwind } => rustc_target::spec::abi::Abi::Vectorcall { unwind }, - Abi::Thiscall { unwind } => rustc_target::spec::abi::Abi::Thiscall { unwind }, - Abi::Aapcs { unwind } => rustc_target::spec::abi::Abi::Aapcs { unwind }, - Abi::Win64 { unwind } => rustc_target::spec::abi::Abi::Win64 { unwind }, - Abi::SysV64 { unwind } => rustc_target::spec::abi::Abi::SysV64 { unwind }, - Abi::PtxKernel => rustc_target::spec::abi::Abi::PtxKernel, - Abi::Msp430Interrupt => rustc_target::spec::abi::Abi::Msp430Interrupt, - Abi::X86Interrupt => rustc_target::spec::abi::Abi::X86Interrupt, - Abi::EfiApi => rustc_target::spec::abi::Abi::EfiApi, - Abi::AvrInterrupt => rustc_target::spec::abi::Abi::AvrInterrupt, - Abi::AvrNonBlockingInterrupt => rustc_target::spec::abi::Abi::AvrNonBlockingInterrupt, - Abi::CCmseNonSecureCall => rustc_target::spec::abi::Abi::CCmseNonSecureCall, - Abi::CCmseNonSecureEntry => rustc_target::spec::abi::Abi::CCmseNonSecureEntry, - Abi::System { unwind } => rustc_target::spec::abi::Abi::System { unwind }, - Abi::RustIntrinsic => rustc_target::spec::abi::Abi::RustIntrinsic, - Abi::RustCall => rustc_target::spec::abi::Abi::RustCall, - Abi::Unadjusted => rustc_target::spec::abi::Abi::Unadjusted, - Abi::RustCold => rustc_target::spec::abi::Abi::RustCold, - Abi::RiscvInterruptM => rustc_target::spec::abi::Abi::RiscvInterruptM, - Abi::RiscvInterruptS => rustc_target::spec::abi::Abi::RiscvInterruptS, + Abi::Rust => rustc_abi::ExternAbi::Rust, + Abi::C { unwind } => rustc_abi::ExternAbi::C { unwind }, + Abi::Cdecl { unwind } => rustc_abi::ExternAbi::Cdecl { unwind }, + Abi::Stdcall { unwind } => rustc_abi::ExternAbi::Stdcall { unwind }, + Abi::Fastcall { unwind } => rustc_abi::ExternAbi::Fastcall { unwind }, + Abi::Vectorcall { unwind } => rustc_abi::ExternAbi::Vectorcall { unwind }, + Abi::Thiscall { unwind } => rustc_abi::ExternAbi::Thiscall { unwind }, + Abi::Aapcs { unwind } => rustc_abi::ExternAbi::Aapcs { unwind }, + Abi::Win64 { unwind } => rustc_abi::ExternAbi::Win64 { unwind }, + Abi::SysV64 { unwind } => rustc_abi::ExternAbi::SysV64 { unwind }, + Abi::PtxKernel => rustc_abi::ExternAbi::PtxKernel, + Abi::Msp430Interrupt => rustc_abi::ExternAbi::Msp430Interrupt, + Abi::X86Interrupt => rustc_abi::ExternAbi::X86Interrupt, + Abi::EfiApi => rustc_abi::ExternAbi::EfiApi, + Abi::AvrInterrupt => rustc_abi::ExternAbi::AvrInterrupt, + Abi::AvrNonBlockingInterrupt => rustc_abi::ExternAbi::AvrNonBlockingInterrupt, + Abi::CCmseNonSecureCall => rustc_abi::ExternAbi::CCmseNonSecureCall, + Abi::CCmseNonSecureEntry => rustc_abi::ExternAbi::CCmseNonSecureEntry, + Abi::System { unwind } => rustc_abi::ExternAbi::System { unwind }, + Abi::RustIntrinsic => rustc_abi::ExternAbi::RustIntrinsic, + Abi::RustCall => rustc_abi::ExternAbi::RustCall, + Abi::Unadjusted => rustc_abi::ExternAbi::Unadjusted, + Abi::RustCold => rustc_abi::ExternAbi::RustCold, + Abi::RiscvInterruptM => rustc_abi::ExternAbi::RiscvInterruptM, + Abi::RiscvInterruptS => rustc_abi::ExternAbi::RiscvInterruptS, } } } @@ -503,7 +503,7 @@ impl RustcInternal for Span { } impl RustcInternal for Layout { - type T<'tcx> = rustc_target::abi::Layout<'tcx>; + type T<'tcx> = rustc_abi::Layout<'tcx>; fn internal<'tcx>(&self, tables: &mut Tables<'_>, tcx: TyCtxt<'tcx>) -> Self::T<'tcx> { tcx.lift(tables.layouts[*self]).unwrap() diff --git a/compiler/rustc_smir/src/rustc_smir/context.rs b/compiler/rustc_smir/src/rustc_smir/context.rs index 9514ec883ae..2d6ca3571fa 100644 --- a/compiler/rustc_smir/src/rustc_smir/context.rs +++ b/compiler/rustc_smir/src/rustc_smir/context.rs @@ -786,7 +786,7 @@ pub(crate) struct TablesWrapper<'tcx>(pub RefCell>); /// Implement error handling for extracting function ABI information. impl<'tcx> FnAbiOfHelpers<'tcx> for Tables<'tcx> { - type FnAbiOfResult = Result<&'tcx rustc_target::abi::call::FnAbi<'tcx, ty::Ty<'tcx>>, Error>; + type FnAbiOfResult = Result<&'tcx rustc_target::callconv::FnAbi<'tcx, ty::Ty<'tcx>>, Error>; #[inline] fn handle_fn_abi_err( diff --git a/compiler/rustc_smir/src/rustc_smir/convert/mod.rs b/compiler/rustc_smir/src/rustc_smir/convert/mod.rs index c9795fca399..4f8da08eff9 100644 --- a/compiler/rustc_smir/src/rustc_smir/convert/mod.rs +++ b/compiler/rustc_smir/src/rustc_smir/convert/mod.rs @@ -1,6 +1,6 @@ //! Conversion of internal Rust compiler items to stable ones. -use rustc_target::abi::FieldIdx; +use rustc_abi::FieldIdx; use crate::rustc_smir::{Stable, Tables}; diff --git a/compiler/rustc_smir/src/rustc_smir/convert/ty.rs b/compiler/rustc_smir/src/rustc_smir/convert/ty.rs index 8f05f859c07..8c510096764 100644 --- a/compiler/rustc_smir/src/rustc_smir/convert/ty.rs +++ b/compiler/rustc_smir/src/rustc_smir/convert/ty.rs @@ -891,38 +891,38 @@ impl<'tcx> Stable<'tcx> for ty::Movability { } } -impl<'tcx> Stable<'tcx> for rustc_target::spec::abi::Abi { +impl<'tcx> Stable<'tcx> for rustc_abi::ExternAbi { type T = stable_mir::ty::Abi; fn stable(&self, _: &mut Tables<'_>) -> Self::T { - use rustc_target::spec::abi; + use rustc_abi::ExternAbi; use stable_mir::ty::Abi; match *self { - abi::Abi::Rust => Abi::Rust, - abi::Abi::C { unwind } => Abi::C { unwind }, - abi::Abi::Cdecl { unwind } => Abi::Cdecl { unwind }, - abi::Abi::Stdcall { unwind } => Abi::Stdcall { unwind }, - abi::Abi::Fastcall { unwind } => Abi::Fastcall { unwind }, - abi::Abi::Vectorcall { unwind } => Abi::Vectorcall { unwind }, - abi::Abi::Thiscall { unwind } => Abi::Thiscall { unwind }, - abi::Abi::Aapcs { unwind } => Abi::Aapcs { unwind }, - abi::Abi::Win64 { unwind } => Abi::Win64 { unwind }, - abi::Abi::SysV64 { unwind } => Abi::SysV64 { unwind }, - abi::Abi::PtxKernel => Abi::PtxKernel, - abi::Abi::Msp430Interrupt => Abi::Msp430Interrupt, - abi::Abi::X86Interrupt => Abi::X86Interrupt, - abi::Abi::EfiApi => Abi::EfiApi, - abi::Abi::AvrInterrupt => Abi::AvrInterrupt, - abi::Abi::AvrNonBlockingInterrupt => Abi::AvrNonBlockingInterrupt, - abi::Abi::CCmseNonSecureCall => Abi::CCmseNonSecureCall, - abi::Abi::CCmseNonSecureEntry => Abi::CCmseNonSecureEntry, - abi::Abi::System { unwind } => Abi::System { unwind }, - abi::Abi::RustIntrinsic => Abi::RustIntrinsic, - abi::Abi::RustCall => Abi::RustCall, - abi::Abi::Unadjusted => Abi::Unadjusted, - abi::Abi::RustCold => Abi::RustCold, - abi::Abi::RiscvInterruptM => Abi::RiscvInterruptM, - abi::Abi::RiscvInterruptS => Abi::RiscvInterruptS, + ExternAbi::Rust => Abi::Rust, + ExternAbi::C { unwind } => Abi::C { unwind }, + ExternAbi::Cdecl { unwind } => Abi::Cdecl { unwind }, + ExternAbi::Stdcall { unwind } => Abi::Stdcall { unwind }, + ExternAbi::Fastcall { unwind } => Abi::Fastcall { unwind }, + ExternAbi::Vectorcall { unwind } => Abi::Vectorcall { unwind }, + ExternAbi::Thiscall { unwind } => Abi::Thiscall { unwind }, + ExternAbi::Aapcs { unwind } => Abi::Aapcs { unwind }, + ExternAbi::Win64 { unwind } => Abi::Win64 { unwind }, + ExternAbi::SysV64 { unwind } => Abi::SysV64 { unwind }, + ExternAbi::PtxKernel => Abi::PtxKernel, + ExternAbi::Msp430Interrupt => Abi::Msp430Interrupt, + ExternAbi::X86Interrupt => Abi::X86Interrupt, + ExternAbi::EfiApi => Abi::EfiApi, + ExternAbi::AvrInterrupt => Abi::AvrInterrupt, + ExternAbi::AvrNonBlockingInterrupt => Abi::AvrNonBlockingInterrupt, + ExternAbi::CCmseNonSecureCall => Abi::CCmseNonSecureCall, + ExternAbi::CCmseNonSecureEntry => Abi::CCmseNonSecureEntry, + ExternAbi::System { unwind } => Abi::System { unwind }, + ExternAbi::RustIntrinsic => Abi::RustIntrinsic, + ExternAbi::RustCall => Abi::RustCall, + ExternAbi::Unadjusted => Abi::Unadjusted, + ExternAbi::RustCold => Abi::RustCold, + ExternAbi::RiscvInterruptM => Abi::RiscvInterruptM, + ExternAbi::RiscvInterruptS => Abi::RiscvInterruptS, } } }