diff --git a/src/abi/comments.rs b/src/abi/comments.rs index daea789ee..521a250ab 100644 --- a/src/abi/comments.rs +++ b/src/abi/comments.rs @@ -3,7 +3,7 @@ use std::borrow::Cow; -use rustc_target::abi::call::PassMode; +use rustc_target::callconv::PassMode; use crate::prelude::*; diff --git a/src/abi/mod.rs b/src/abi/mod.rs index dfca5dcbe..f647ee36c 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -10,6 +10,7 @@ use std::mem; use cranelift_codegen::ir::{ArgumentPurpose, SigRef}; use cranelift_codegen::isa::CallConv; use cranelift_module::ModuleError; +use rustc_abi::ExternAbi; use rustc_codegen_ssa::base::is_call_from_compiler_builtins_to_upstream_monomorphization; use rustc_codegen_ssa::errors::CompilerBuiltinsCannotCall; use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; @@ -18,8 +19,7 @@ use rustc_middle::ty::layout::FnAbiOf; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_session::Session; use rustc_span::source_map::Spanned; -use rustc_target::abi::call::{Conv, FnAbi, PassMode}; -use rustc_target::spec::abi::Abi; +use rustc_target::callconv::{Conv, FnAbi, PassMode}; use self::pass_mode::*; pub(crate) use self::returning::codegen_return; @@ -443,7 +443,7 @@ pub(crate) fn codegen_terminator_call<'tcx>( RevealAllLayoutCx(fx.tcx).fn_abi_of_fn_ptr(fn_sig, extra_args) }; - let is_cold = if fn_sig.abi() == Abi::RustCold { + let is_cold = if fn_sig.abi() == ExternAbi::RustCold { true } else { instance.is_some_and(|inst| { @@ -458,7 +458,7 @@ pub(crate) fn codegen_terminator_call<'tcx>( } // Unpack arguments tuple for closures - let mut args = if fn_sig.abi() == Abi::RustCall { + let mut args = if fn_sig.abi() == ExternAbi::RustCall { let (self_arg, pack_arg) = match args { [pack_arg] => (None, codegen_call_argument_operand(fx, &pack_arg.node)), [self_arg, pack_arg] => ( diff --git a/src/abi/pass_mode.rs b/src/abi/pass_mode.rs index ad0a13dc7..7594a53fc 100644 --- a/src/abi/pass_mode.rs +++ b/src/abi/pass_mode.rs @@ -1,8 +1,9 @@ //! Argument passing use cranelift_codegen::ir::{ArgumentExtension, ArgumentPurpose}; -use rustc_target::abi::call::{ - ArgAbi, ArgAttributes, ArgExtension as RustcArgExtension, CastTarget, PassMode, Reg, RegKind, +use rustc_abi::{Reg, RegKind}; +use rustc_target::callconv::{ + ArgAbi, ArgAttributes, ArgExtension as RustcArgExtension, CastTarget, PassMode, }; use smallvec::{SmallVec, smallvec}; diff --git a/src/abi/returning.rs b/src/abi/returning.rs index a294c789b..9e048c7ba 100644 --- a/src/abi/returning.rs +++ b/src/abi/returning.rs @@ -1,6 +1,6 @@ //! Return value handling -use rustc_target::abi::call::{ArgAbi, PassMode}; +use rustc_target::callconv::{ArgAbi, PassMode}; use smallvec::{SmallVec, smallvec}; use crate::prelude::*; diff --git a/src/base.rs b/src/base.rs index 10d5dce9b..da3818ca2 100644 --- a/src/base.rs +++ b/src/base.rs @@ -934,7 +934,7 @@ fn codegen_stmt<'tcx>( let dst = codegen_operand(fx, dst); let pointee = dst .layout() - .pointee_info_at(fx, rustc_target::abi::Size::ZERO) + .pointee_info_at(fx, rustc_abi::Size::ZERO) .expect("Expected pointer"); let dst = dst.load_scalar(fx); let src = codegen_operand(fx, src).load_scalar(fx); diff --git a/src/common.rs b/src/common.rs index 69a32cc3d..27e71b925 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,13 +1,13 @@ use cranelift_codegen::isa::TargetFrontendConfig; use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; +use rustc_abi::{Float, Integer, Primitive}; use rustc_index::IndexVec; use rustc_middle::ty::TypeFoldable; use rustc_middle::ty::layout::{ self, FnAbiError, FnAbiOfHelpers, FnAbiRequest, LayoutError, LayoutOfHelpers, }; use rustc_span::source_map::Spanned; -use rustc_target::abi::call::FnAbi; -use rustc_target::abi::{Float, Integer, Primitive}; +use rustc_target::callconv::FnAbi; use rustc_target::spec::{HasTargetSpec, Target}; use crate::constant::ConstantCx; @@ -162,8 +162,8 @@ pub(crate) fn codegen_icmp_imm( pub(crate) fn codegen_bitcast(fx: &mut FunctionCx<'_, '_, '_>, dst_ty: Type, val: Value) -> Value { let mut flags = MemFlags::new(); flags.set_endianness(match fx.tcx.data_layout.endian { - rustc_target::abi::Endian::Big => cranelift_codegen::ir::Endianness::Big, - rustc_target::abi::Endian::Little => cranelift_codegen::ir::Endianness::Little, + rustc_abi::Endian::Big => cranelift_codegen::ir::Endianness::Big, + rustc_abi::Endian::Little => cranelift_codegen::ir::Endianness::Little, }); fx.bcx.ins().bitcast(dst_ty, flags, val) } @@ -333,8 +333,8 @@ impl<'tcx> layout::HasTyCtxt<'tcx> for FunctionCx<'_, '_, 'tcx> { } } -impl<'tcx> rustc_target::abi::HasDataLayout for FunctionCx<'_, '_, 'tcx> { - fn data_layout(&self) -> &rustc_target::abi::TargetDataLayout { +impl<'tcx> rustc_abi::HasDataLayout for FunctionCx<'_, '_, 'tcx> { + fn data_layout(&self) -> &rustc_abi::TargetDataLayout { &self.tcx.data_layout } } @@ -491,8 +491,8 @@ impl<'tcx> layout::HasTyCtxt<'tcx> for RevealAllLayoutCx<'tcx> { } } -impl<'tcx> rustc_target::abi::HasDataLayout for RevealAllLayoutCx<'tcx> { - fn data_layout(&self) -> &rustc_target::abi::TargetDataLayout { +impl<'tcx> rustc_abi::HasDataLayout for RevealAllLayoutCx<'tcx> { + fn data_layout(&self) -> &rustc_abi::TargetDataLayout { &self.0.data_layout } } diff --git a/src/debuginfo/mod.rs b/src/debuginfo/mod.rs index 78ae43b1c..9025ea97b 100644 --- a/src/debuginfo/mod.rs +++ b/src/debuginfo/mod.rs @@ -20,7 +20,7 @@ use rustc_hir::def::DefKind; use rustc_hir::def_id::DefIdMap; use rustc_session::Session; use rustc_span::{FileNameDisplayPreference, SourceFileHash, StableSourceFileId}; -use rustc_target::abi::call::FnAbi; +use rustc_target::callconv::FnAbi; pub(crate) use self::emit::{DebugReloc, DebugRelocName}; pub(crate) use self::types::TypeDebugContext; diff --git a/src/inline_asm.rs b/src/inline_asm.rs index 0fbd5a168..a3f816f70 100644 --- a/src/inline_asm.rs +++ b/src/inline_asm.rs @@ -464,7 +464,7 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> { let new_slot_fn = |slot_size: &mut Size, reg_class: InlineAsmRegClass| { let reg_size = reg_class.supported_types(self.arch).iter().map(|(ty, _)| ty.size()).max().unwrap(); - let align = rustc_target::abi::Align::from_bytes(reg_size.bytes()).unwrap(); + let align = rustc_abi::Align::from_bytes(reg_size.bytes()).unwrap(); let offset = slot_size.align_to(align); *slot_size = offset + reg_size; offset diff --git a/src/intrinsics/simd.rs b/src/intrinsics/simd.rs index 16fb68a7b..816cab4b1 100644 --- a/src/intrinsics/simd.rs +++ b/src/intrinsics/simd.rs @@ -1,7 +1,7 @@ //! Codegen `extern "platform-intrinsic"` intrinsics. use cranelift_codegen::ir::immediates::Offset32; -use rustc_target::abi::Endian; +use rustc_abi::Endian; use super::*; use crate::prelude::*; diff --git a/src/pointer.rs b/src/pointer.rs index 11ac6b946..2750caa21 100644 --- a/src/pointer.rs +++ b/src/pointer.rs @@ -2,7 +2,7 @@ //! operations. use cranelift_codegen::ir::immediates::Offset32; -use rustc_target::abi::Align; +use rustc_abi::Align; use crate::prelude::*; diff --git a/src/pretty_clif.rs b/src/pretty_clif.rs index 282763279..cd254b04e 100644 --- a/src/pretty_clif.rs +++ b/src/pretty_clif.rs @@ -64,7 +64,7 @@ use cranelift_codegen::ir::entities::AnyEntity; use cranelift_codegen::write::{FuncWriter, PlainWriter}; use rustc_middle::ty::print::with_no_trimmed_paths; use rustc_session::config::{OutputFilenames, OutputType}; -use rustc_target::abi::call::FnAbi; +use rustc_target::callconv::FnAbi; use crate::prelude::*;