compiler: Directly use rustc_abi in smir again

This commit is contained in:
Jubilee Young 2024-11-02 19:33:04 -07:00
parent 843b6e0859
commit 6c16a3123b
4 changed files with 58 additions and 58 deletions

View File

@ -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()

View File

@ -786,7 +786,7 @@ pub(crate) struct TablesWrapper<'tcx>(pub RefCell<Tables<'tcx>>);
/// 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(

View File

@ -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};

View File

@ -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,
}
}
}