compiler: Directly use rustc_abi in codegen
This commit is contained in:
parent
e3a918ece0
commit
b895bf4fdc
35 changed files with 50 additions and 52 deletions
|
@ -11,6 +11,7 @@ use object::{
|
|||
SectionFlags, SectionKind, SubArchitecture, SymbolFlags, SymbolKind, SymbolScope, elf, pe,
|
||||
xcoff,
|
||||
};
|
||||
use rustc_abi::Endian;
|
||||
use rustc_data_structures::memmap::Mmap;
|
||||
use rustc_data_structures::owned_slice::{OwnedSlice, try_slice_owned};
|
||||
use rustc_metadata::EncodedMetadata;
|
||||
|
@ -19,7 +20,6 @@ use rustc_metadata::fs::METADATA_FILENAME;
|
|||
use rustc_middle::bug;
|
||||
use rustc_session::Session;
|
||||
use rustc_span::sym;
|
||||
use rustc_target::abi::Endian;
|
||||
use rustc_target::spec::{RelocModel, Target, ef_avr_arch};
|
||||
|
||||
use super::apple;
|
||||
|
|
|
@ -548,7 +548,7 @@ pub(crate) fn linking_symbol_name_for_instance_in_crate<'tcx>(
|
|||
symbol: ExportedSymbol<'tcx>,
|
||||
instantiating_crate: CrateNum,
|
||||
) -> String {
|
||||
use rustc_target::abi::call::Conv;
|
||||
use rustc_target::callconv::Conv;
|
||||
|
||||
let mut undecorated = symbol_name_for_instance_in_crate(tcx, symbol, instantiating_crate);
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ use std::collections::BTreeSet;
|
|||
use std::time::{Duration, Instant};
|
||||
|
||||
use itertools::Itertools;
|
||||
use rustc_abi::FIRST_VARIANT;
|
||||
use rustc_ast::expand::allocator::{ALLOCATOR_METHODS, AllocatorKind, global_fn_name};
|
||||
use rustc_attr as attr;
|
||||
use rustc_data_structures::fx::{FxHashMap, FxIndexSet};
|
||||
|
@ -26,7 +27,6 @@ use rustc_session::Session;
|
|||
use rustc_session::config::{self, CrateType, EntryFnType, OptLevel, OutputType};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{DUMMY_SP, Symbol};
|
||||
use rustc_target::abi::FIRST_VARIANT;
|
||||
use rustc_trait_selection::infer::at::ToTrace;
|
||||
use rustc_trait_selection::infer::{BoundRegionConversionTime, TyCtxtInferExt};
|
||||
use rustc_trait_selection::traits::{ObligationCause, ObligationCtxt};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use rustc_abi::{Integer, Primitive, Size, TagEncoding, Variants};
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::ty::layout::{IntegerExt, PrimitiveExt, TyAndLayout};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_target::abi::{Integer, Primitive, Size, TagEncoding, Variants};
|
||||
|
||||
// FIXME(eddyb) find a place for this (or a way to replace it).
|
||||
pub mod type_names;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
use std::fmt::Write;
|
||||
|
||||
use rustc_abi::Integer;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_data_structures::stable_hasher::{Hash64, HashStable, StableHasher};
|
||||
use rustc_hir::def_id::DefId;
|
||||
|
@ -23,7 +24,6 @@ use rustc_middle::ty::layout::{IntegerExt, TyAndLayout};
|
|||
use rustc_middle::ty::{
|
||||
self, ExistentialProjection, GenericArgKind, GenericArgsRef, ParamEnv, Ty, TyCtxt,
|
||||
};
|
||||
use rustc_target::abi::Integer;
|
||||
use smallvec::SmallVec;
|
||||
|
||||
use crate::debuginfo::wants_c_like_enum_debuginfo;
|
||||
|
@ -364,7 +364,7 @@ fn push_debuginfo_type_name<'tcx>(
|
|||
} else {
|
||||
output.push_str(sig.safety.prefix_str());
|
||||
|
||||
if sig.abi != rustc_target::spec::abi::Abi::Rust {
|
||||
if sig.abi != rustc_abi::ExternAbi::Rust {
|
||||
output.push_str("extern \"");
|
||||
output.push_str(sig.abi.name());
|
||||
output.push_str("\" ");
|
||||
|
|
|
@ -2,7 +2,7 @@ use rustc_middle::bug;
|
|||
use rustc_middle::ty::{self, GenericArgKind, Ty};
|
||||
use rustc_session::config::Lto;
|
||||
use rustc_symbol_mangling::typeid_for_trait_ref;
|
||||
use rustc_target::abi::call::FnAbi;
|
||||
use rustc_target::callconv::FnAbi;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use crate::traits::*;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
use std::cmp;
|
||||
|
||||
use rustc_abi::{self as abi, ExternAbi, HasDataLayout, WrappingRange};
|
||||
use rustc_ast as ast;
|
||||
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
|
||||
use rustc_hir::lang_items::LangItem;
|
||||
|
@ -13,9 +14,7 @@ use rustc_middle::{bug, span_bug};
|
|||
use rustc_session::config::OptLevel;
|
||||
use rustc_span::source_map::Spanned;
|
||||
use rustc_span::{Span, sym};
|
||||
use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode, Reg};
|
||||
use rustc_target::abi::{self, HasDataLayout, WrappingRange};
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use rustc_target::callconv::{ArgAbi, FnAbi, PassMode, Reg};
|
||||
use tracing::{debug, info};
|
||||
|
||||
use super::operand::OperandRef;
|
||||
|
@ -977,7 +976,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
});
|
||||
|
||||
// Split the rust-call tupled arguments off.
|
||||
let (first_args, untuple) = if abi == Abi::RustCall && !args.is_empty() {
|
||||
let (first_args, untuple) = if abi == ExternAbi::RustCall && !args.is_empty() {
|
||||
let (tup, args) = args.split_last().unwrap();
|
||||
(args, Some(tup))
|
||||
} else {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use rustc_abi::WrappingRange;
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
use rustc_session::config::OptLevel;
|
||||
use rustc_span::{Span, sym};
|
||||
use rustc_target::abi::WrappingRange;
|
||||
use rustc_target::abi::call::{FnAbi, PassMode};
|
||||
use rustc_target::callconv::{FnAbi, PassMode};
|
||||
|
||||
use super::FunctionCx;
|
||||
use super::operand::OperandRef;
|
||||
|
|
|
@ -7,7 +7,7 @@ use rustc_middle::mir::{UnwindTerminateReason, traversal};
|
|||
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, TyAndLayout};
|
||||
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable, TypeVisitableExt};
|
||||
use rustc_middle::{bug, mir, span_bug};
|
||||
use rustc_target::abi::call::{FnAbi, PassMode};
|
||||
use rustc_target::callconv::{FnAbi, PassMode};
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use crate::base;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
use rustc_abi::Primitive::{Int, Pointer};
|
||||
use rustc_abi::{Align, FieldsShape, Size, TagEncoding, Variants};
|
||||
use rustc_abi::{Align, FieldsShape, Size, TagEncoding, VariantIdx, Variants};
|
||||
use rustc_middle::mir::tcx::PlaceTy;
|
||||
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_middle::{bug, mir};
|
||||
use rustc_target::abi::VariantIdx;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use super::operand::OperandValue;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
use std::assert_matches::assert_matches;
|
||||
|
||||
use arrayvec::ArrayVec;
|
||||
use rustc_abi::{self as abi, FIRST_VARIANT, FieldIdx};
|
||||
use rustc_middle::ty::adjustment::PointerCoercion;
|
||||
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
|
||||
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
|
||||
use rustc_middle::{bug, mir, span_bug};
|
||||
use rustc_session::config::OptLevel;
|
||||
use rustc_span::{DUMMY_SP, Span};
|
||||
use rustc_target::abi::{self, FIRST_VARIANT, FieldIdx};
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use super::operand::{OperandRef, OperandValue};
|
||||
|
|
|
@ -78,7 +78,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
let count = self.codegen_operand(bx, count).immediate();
|
||||
let pointee_layout = dst_val
|
||||
.layout
|
||||
.pointee_info_at(bx, rustc_target::abi::Size::ZERO)
|
||||
.pointee_info_at(bx, rustc_abi::Size::ZERO)
|
||||
.expect("Expected pointer");
|
||||
let bytes = bx.mul(count, bx.const_usize(pointee_layout.size.bytes()));
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
//! Computing the size and alignment of a value.
|
||||
|
||||
use rustc_abi::WrappingRange;
|
||||
use rustc_hir::LangItem;
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths};
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_target::abi::WrappingRange;
|
||||
use tracing::{debug, trace};
|
||||
|
||||
use crate::common::IntPredicate;
|
||||
|
|
|
@ -7,7 +7,7 @@ use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
|
|||
use rustc_middle::ty::{Instance, Ty};
|
||||
use rustc_session::config::OptLevel;
|
||||
use rustc_span::Span;
|
||||
use rustc_target::abi::call::FnAbi;
|
||||
use rustc_target::callconv::FnAbi;
|
||||
|
||||
use super::abi::AbiBuilderMethods;
|
||||
use super::asm::AsmBuilderMethods;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use std::ops::Range;
|
||||
|
||||
use rustc_abi::Size;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::ty::{Instance, PolyExistentialTraitRef, Ty};
|
||||
use rustc_span::{SourceFile, Span, Symbol};
|
||||
use rustc_target::abi::Size;
|
||||
use rustc_target::abi::call::FnAbi;
|
||||
use rustc_target::callconv::FnAbi;
|
||||
|
||||
use super::BackendTypes;
|
||||
use crate::mir::debuginfo::{FunctionDebugContext, VariableKind};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_span::Span;
|
||||
use rustc_target::abi::call::FnAbi;
|
||||
use rustc_target::callconv::FnAbi;
|
||||
|
||||
use super::BackendTypes;
|
||||
use crate::mir::operand::OperandRef;
|
||||
|
|
|
@ -29,7 +29,7 @@ use std::fmt;
|
|||
|
||||
use rustc_middle::ty::Ty;
|
||||
use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
|
||||
use rustc_target::abi::call::FnAbi;
|
||||
use rustc_target::callconv::FnAbi;
|
||||
|
||||
pub use self::abi::AbiBuilderMethods;
|
||||
pub use self::asm::{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use rustc_abi::Align;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_target::abi::Align;
|
||||
|
||||
use super::BackendTypes;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use rustc_abi::{AddressSpace, Float, Integer};
|
||||
use rustc_middle::bug;
|
||||
use rustc_middle::ty::layout::{HasTyCtxt, TyAndLayout};
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_target::abi::call::{ArgAbi, CastTarget, FnAbi, Reg};
|
||||
use rustc_target::abi::{AddressSpace, Float, Integer};
|
||||
use rustc_target::callconv::{ArgAbi, CastTarget, FnAbi, Reg};
|
||||
|
||||
use super::BackendTypes;
|
||||
use super::misc::MiscCodegenMethods;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue