mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
compiler: Directly use rustc_abi in smir again
This commit is contained in:
parent
843b6e0859
commit
6c16a3123b
@ -237,10 +237,10 @@ impl RustcInternal for FnSig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl RustcInternal for VariantIdx {
|
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> {
|
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 {
|
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> {
|
fn internal<'tcx>(&self, _tables: &mut Tables<'_>, _tcx: TyCtxt<'tcx>) -> Self::T<'tcx> {
|
||||||
match *self {
|
match *self {
|
||||||
Abi::Rust => rustc_target::spec::abi::Abi::Rust,
|
Abi::Rust => rustc_abi::ExternAbi::Rust,
|
||||||
Abi::C { unwind } => rustc_target::spec::abi::Abi::C { unwind },
|
Abi::C { unwind } => rustc_abi::ExternAbi::C { unwind },
|
||||||
Abi::Cdecl { unwind } => rustc_target::spec::abi::Abi::Cdecl { unwind },
|
Abi::Cdecl { unwind } => rustc_abi::ExternAbi::Cdecl { unwind },
|
||||||
Abi::Stdcall { unwind } => rustc_target::spec::abi::Abi::Stdcall { unwind },
|
Abi::Stdcall { unwind } => rustc_abi::ExternAbi::Stdcall { unwind },
|
||||||
Abi::Fastcall { unwind } => rustc_target::spec::abi::Abi::Fastcall { unwind },
|
Abi::Fastcall { unwind } => rustc_abi::ExternAbi::Fastcall { unwind },
|
||||||
Abi::Vectorcall { unwind } => rustc_target::spec::abi::Abi::Vectorcall { unwind },
|
Abi::Vectorcall { unwind } => rustc_abi::ExternAbi::Vectorcall { unwind },
|
||||||
Abi::Thiscall { unwind } => rustc_target::spec::abi::Abi::Thiscall { unwind },
|
Abi::Thiscall { unwind } => rustc_abi::ExternAbi::Thiscall { unwind },
|
||||||
Abi::Aapcs { unwind } => rustc_target::spec::abi::Abi::Aapcs { unwind },
|
Abi::Aapcs { unwind } => rustc_abi::ExternAbi::Aapcs { unwind },
|
||||||
Abi::Win64 { unwind } => rustc_target::spec::abi::Abi::Win64 { unwind },
|
Abi::Win64 { unwind } => rustc_abi::ExternAbi::Win64 { unwind },
|
||||||
Abi::SysV64 { unwind } => rustc_target::spec::abi::Abi::SysV64 { unwind },
|
Abi::SysV64 { unwind } => rustc_abi::ExternAbi::SysV64 { unwind },
|
||||||
Abi::PtxKernel => rustc_target::spec::abi::Abi::PtxKernel,
|
Abi::PtxKernel => rustc_abi::ExternAbi::PtxKernel,
|
||||||
Abi::Msp430Interrupt => rustc_target::spec::abi::Abi::Msp430Interrupt,
|
Abi::Msp430Interrupt => rustc_abi::ExternAbi::Msp430Interrupt,
|
||||||
Abi::X86Interrupt => rustc_target::spec::abi::Abi::X86Interrupt,
|
Abi::X86Interrupt => rustc_abi::ExternAbi::X86Interrupt,
|
||||||
Abi::EfiApi => rustc_target::spec::abi::Abi::EfiApi,
|
Abi::EfiApi => rustc_abi::ExternAbi::EfiApi,
|
||||||
Abi::AvrInterrupt => rustc_target::spec::abi::Abi::AvrInterrupt,
|
Abi::AvrInterrupt => rustc_abi::ExternAbi::AvrInterrupt,
|
||||||
Abi::AvrNonBlockingInterrupt => rustc_target::spec::abi::Abi::AvrNonBlockingInterrupt,
|
Abi::AvrNonBlockingInterrupt => rustc_abi::ExternAbi::AvrNonBlockingInterrupt,
|
||||||
Abi::CCmseNonSecureCall => rustc_target::spec::abi::Abi::CCmseNonSecureCall,
|
Abi::CCmseNonSecureCall => rustc_abi::ExternAbi::CCmseNonSecureCall,
|
||||||
Abi::CCmseNonSecureEntry => rustc_target::spec::abi::Abi::CCmseNonSecureEntry,
|
Abi::CCmseNonSecureEntry => rustc_abi::ExternAbi::CCmseNonSecureEntry,
|
||||||
Abi::System { unwind } => rustc_target::spec::abi::Abi::System { unwind },
|
Abi::System { unwind } => rustc_abi::ExternAbi::System { unwind },
|
||||||
Abi::RustIntrinsic => rustc_target::spec::abi::Abi::RustIntrinsic,
|
Abi::RustIntrinsic => rustc_abi::ExternAbi::RustIntrinsic,
|
||||||
Abi::RustCall => rustc_target::spec::abi::Abi::RustCall,
|
Abi::RustCall => rustc_abi::ExternAbi::RustCall,
|
||||||
Abi::Unadjusted => rustc_target::spec::abi::Abi::Unadjusted,
|
Abi::Unadjusted => rustc_abi::ExternAbi::Unadjusted,
|
||||||
Abi::RustCold => rustc_target::spec::abi::Abi::RustCold,
|
Abi::RustCold => rustc_abi::ExternAbi::RustCold,
|
||||||
Abi::RiscvInterruptM => rustc_target::spec::abi::Abi::RiscvInterruptM,
|
Abi::RiscvInterruptM => rustc_abi::ExternAbi::RiscvInterruptM,
|
||||||
Abi::RiscvInterruptS => rustc_target::spec::abi::Abi::RiscvInterruptS,
|
Abi::RiscvInterruptS => rustc_abi::ExternAbi::RiscvInterruptS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -503,7 +503,7 @@ impl RustcInternal for Span {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl RustcInternal for Layout {
|
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> {
|
fn internal<'tcx>(&self, tables: &mut Tables<'_>, tcx: TyCtxt<'tcx>) -> Self::T<'tcx> {
|
||||||
tcx.lift(tables.layouts[*self]).unwrap()
|
tcx.lift(tables.layouts[*self]).unwrap()
|
||||||
|
@ -786,7 +786,7 @@ pub(crate) struct TablesWrapper<'tcx>(pub RefCell<Tables<'tcx>>);
|
|||||||
|
|
||||||
/// Implement error handling for extracting function ABI information.
|
/// Implement error handling for extracting function ABI information.
|
||||||
impl<'tcx> FnAbiOfHelpers<'tcx> for Tables<'tcx> {
|
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]
|
#[inline]
|
||||||
fn handle_fn_abi_err(
|
fn handle_fn_abi_err(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
//! Conversion of internal Rust compiler items to stable ones.
|
//! Conversion of internal Rust compiler items to stable ones.
|
||||||
|
|
||||||
use rustc_target::abi::FieldIdx;
|
use rustc_abi::FieldIdx;
|
||||||
|
|
||||||
use crate::rustc_smir::{Stable, Tables};
|
use crate::rustc_smir::{Stable, Tables};
|
||||||
|
|
||||||
|
@ -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;
|
type T = stable_mir::ty::Abi;
|
||||||
|
|
||||||
fn stable(&self, _: &mut Tables<'_>) -> Self::T {
|
fn stable(&self, _: &mut Tables<'_>) -> Self::T {
|
||||||
use rustc_target::spec::abi;
|
use rustc_abi::ExternAbi;
|
||||||
use stable_mir::ty::Abi;
|
use stable_mir::ty::Abi;
|
||||||
match *self {
|
match *self {
|
||||||
abi::Abi::Rust => Abi::Rust,
|
ExternAbi::Rust => Abi::Rust,
|
||||||
abi::Abi::C { unwind } => Abi::C { unwind },
|
ExternAbi::C { unwind } => Abi::C { unwind },
|
||||||
abi::Abi::Cdecl { unwind } => Abi::Cdecl { unwind },
|
ExternAbi::Cdecl { unwind } => Abi::Cdecl { unwind },
|
||||||
abi::Abi::Stdcall { unwind } => Abi::Stdcall { unwind },
|
ExternAbi::Stdcall { unwind } => Abi::Stdcall { unwind },
|
||||||
abi::Abi::Fastcall { unwind } => Abi::Fastcall { unwind },
|
ExternAbi::Fastcall { unwind } => Abi::Fastcall { unwind },
|
||||||
abi::Abi::Vectorcall { unwind } => Abi::Vectorcall { unwind },
|
ExternAbi::Vectorcall { unwind } => Abi::Vectorcall { unwind },
|
||||||
abi::Abi::Thiscall { unwind } => Abi::Thiscall { unwind },
|
ExternAbi::Thiscall { unwind } => Abi::Thiscall { unwind },
|
||||||
abi::Abi::Aapcs { unwind } => Abi::Aapcs { unwind },
|
ExternAbi::Aapcs { unwind } => Abi::Aapcs { unwind },
|
||||||
abi::Abi::Win64 { unwind } => Abi::Win64 { unwind },
|
ExternAbi::Win64 { unwind } => Abi::Win64 { unwind },
|
||||||
abi::Abi::SysV64 { unwind } => Abi::SysV64 { unwind },
|
ExternAbi::SysV64 { unwind } => Abi::SysV64 { unwind },
|
||||||
abi::Abi::PtxKernel => Abi::PtxKernel,
|
ExternAbi::PtxKernel => Abi::PtxKernel,
|
||||||
abi::Abi::Msp430Interrupt => Abi::Msp430Interrupt,
|
ExternAbi::Msp430Interrupt => Abi::Msp430Interrupt,
|
||||||
abi::Abi::X86Interrupt => Abi::X86Interrupt,
|
ExternAbi::X86Interrupt => Abi::X86Interrupt,
|
||||||
abi::Abi::EfiApi => Abi::EfiApi,
|
ExternAbi::EfiApi => Abi::EfiApi,
|
||||||
abi::Abi::AvrInterrupt => Abi::AvrInterrupt,
|
ExternAbi::AvrInterrupt => Abi::AvrInterrupt,
|
||||||
abi::Abi::AvrNonBlockingInterrupt => Abi::AvrNonBlockingInterrupt,
|
ExternAbi::AvrNonBlockingInterrupt => Abi::AvrNonBlockingInterrupt,
|
||||||
abi::Abi::CCmseNonSecureCall => Abi::CCmseNonSecureCall,
|
ExternAbi::CCmseNonSecureCall => Abi::CCmseNonSecureCall,
|
||||||
abi::Abi::CCmseNonSecureEntry => Abi::CCmseNonSecureEntry,
|
ExternAbi::CCmseNonSecureEntry => Abi::CCmseNonSecureEntry,
|
||||||
abi::Abi::System { unwind } => Abi::System { unwind },
|
ExternAbi::System { unwind } => Abi::System { unwind },
|
||||||
abi::Abi::RustIntrinsic => Abi::RustIntrinsic,
|
ExternAbi::RustIntrinsic => Abi::RustIntrinsic,
|
||||||
abi::Abi::RustCall => Abi::RustCall,
|
ExternAbi::RustCall => Abi::RustCall,
|
||||||
abi::Abi::Unadjusted => Abi::Unadjusted,
|
ExternAbi::Unadjusted => Abi::Unadjusted,
|
||||||
abi::Abi::RustCold => Abi::RustCold,
|
ExternAbi::RustCold => Abi::RustCold,
|
||||||
abi::Abi::RiscvInterruptM => Abi::RiscvInterruptM,
|
ExternAbi::RiscvInterruptM => Abi::RiscvInterruptM,
|
||||||
abi::Abi::RiscvInterruptS => Abi::RiscvInterruptS,
|
ExternAbi::RiscvInterruptS => Abi::RiscvInterruptS,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user