Rustup to rustc 1.44.0-nightly (699f83f52
2020-03-29)
This commit is contained in:
parent
203b0b6b11
commit
017a9b7641
14 changed files with 45 additions and 45 deletions
|
@ -1 +1 @@
|
|||
nightly-2020-03-28
|
||||
nightly-2020-03-30
|
||||
|
|
|
@ -61,7 +61,7 @@ pub(super) fn add_local_place_comments<'tcx>(
|
|||
place: CPlace<'tcx>,
|
||||
local: Local,
|
||||
) {
|
||||
let TyLayout { ty, layout } = place.layout();
|
||||
let TyAndLayout { ty, layout } = place.layout();
|
||||
let ty::layout::Layout {
|
||||
size,
|
||||
align,
|
||||
|
|
|
@ -271,7 +271,7 @@ impl<'tcx, B: Backend + 'static> FunctionCx<'_, 'tcx, B> {
|
|||
fn local_place<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
local: Local,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
is_ssa: bool,
|
||||
) -> CPlace<'tcx> {
|
||||
let place = if is_ssa {
|
||||
|
|
|
@ -76,7 +76,7 @@ impl PassMode {
|
|||
}
|
||||
}
|
||||
|
||||
pub(super) fn get_pass_mode<'tcx>(tcx: TyCtxt<'tcx>, layout: TyLayout<'tcx>) -> PassMode {
|
||||
pub(super) fn get_pass_mode<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> PassMode {
|
||||
if layout.is_zst() {
|
||||
// WARNING zst arguments must never be passed, as that will break CastKind::ClosureFnPointer
|
||||
PassMode::NoPass
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use crate::abi::pass_mode::*;
|
||||
use crate::prelude::*;
|
||||
|
||||
fn return_layout<'a, 'tcx>(fx: &mut FunctionCx<'a, 'tcx, impl Backend>) -> TyLayout<'tcx> {
|
||||
fn return_layout<'a, 'tcx>(fx: &mut FunctionCx<'a, 'tcx, impl Backend>) -> TyAndLayout<'tcx> {
|
||||
fx.layout_of(fx.monomorphize(&fx.mir.local_decls[RETURN_PLACE].ty))
|
||||
}
|
||||
|
||||
pub(crate) fn can_return_to_ssa_var<'tcx>(tcx: TyCtxt<'tcx>, dest_layout: TyLayout<'tcx>) -> bool {
|
||||
pub(crate) fn can_return_to_ssa_var<'tcx>(tcx: TyCtxt<'tcx>, dest_layout: TyAndLayout<'tcx>) -> bool {
|
||||
match get_pass_mode(tcx, dest_layout) {
|
||||
PassMode::NoPass | PassMode::ByVal(_) => true,
|
||||
// FIXME Make it possible to return ByValPair and ByRef to an ssa var.
|
||||
|
|
|
@ -282,9 +282,9 @@ pub(crate) struct FunctionCx<'clif, 'tcx, B: Backend + 'static> {
|
|||
|
||||
impl<'tcx, B: Backend> LayoutOf for FunctionCx<'_, 'tcx, B> {
|
||||
type Ty = Ty<'tcx>;
|
||||
type TyLayout = TyLayout<'tcx>;
|
||||
type TyAndLayout = TyAndLayout<'tcx>;
|
||||
|
||||
fn layout_of(&self, ty: Ty<'tcx>) -> TyLayout<'tcx> {
|
||||
fn layout_of(&self, ty: Ty<'tcx>) -> TyAndLayout<'tcx> {
|
||||
assert!(!ty.needs_subst());
|
||||
self.tcx
|
||||
.layout_of(ParamEnv::reveal_all().and(&ty))
|
||||
|
|
|
@ -46,7 +46,7 @@ pub(crate) fn codegen_static(constants_cx: &mut ConstantCx, def_id: DefId) {
|
|||
fn codegen_static_ref<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
def_id: DefId,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
) -> CPlace<'tcx> {
|
||||
let linkage = crate::linkage::get_static_ref_linkage(fx.tcx, def_id);
|
||||
let data_id = data_id_for_static(fx.tcx, fx.module, def_id, linkage);
|
||||
|
@ -277,7 +277,7 @@ fn data_id_for_static(
|
|||
|
||||
fn cplace_for_dataid<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
local_data_id: GlobalValue,
|
||||
) -> CPlace<'tcx> {
|
||||
let global_ptr = fx.bcx.ins().global_value(fx.pointer_type, local_data_id);
|
||||
|
|
|
@ -55,7 +55,7 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
|
|||
pub(crate) fn codegen_get_discriminant<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
value: CValue<'tcx>,
|
||||
dest_layout: TyLayout<'tcx>,
|
||||
dest_layout: TyAndLayout<'tcx>,
|
||||
) -> CValue<'tcx> {
|
||||
let layout = value.layout();
|
||||
|
||||
|
|
|
@ -140,8 +140,8 @@ macro atomic_minmax($fx:expr, $cc:expr, <$T:ident> ($ptr:ident, $src:ident) -> $
|
|||
|
||||
fn lane_type_and_count<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
layout: TyLayout<'tcx>,
|
||||
) -> (TyLayout<'tcx>, u16) {
|
||||
layout: TyAndLayout<'tcx>,
|
||||
) -> (TyAndLayout<'tcx>, u16) {
|
||||
assert!(layout.ty.is_simd());
|
||||
let lane_count = match layout.fields {
|
||||
layout::FieldPlacement::Array { stride: _, count } => u16::try_from(count).unwrap(),
|
||||
|
@ -154,7 +154,7 @@ fn lane_type_and_count<'tcx>(
|
|||
(lane_layout, lane_count)
|
||||
}
|
||||
|
||||
fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyLayout<'tcx>) -> Option<Type> {
|
||||
fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> Option<Type> {
|
||||
let (element, count) = match &layout.abi {
|
||||
Abi::Vector { element, count } => (element.clone(), *count),
|
||||
_ => unreachable!(),
|
||||
|
@ -175,8 +175,8 @@ fn simd_for_each_lane<'tcx, B: Backend>(
|
|||
ret: CPlace<'tcx>,
|
||||
f: impl Fn(
|
||||
&mut FunctionCx<'_, 'tcx, B>,
|
||||
TyLayout<'tcx>,
|
||||
TyLayout<'tcx>,
|
||||
TyAndLayout<'tcx>,
|
||||
TyAndLayout<'tcx>,
|
||||
Value,
|
||||
) -> CValue<'tcx>,
|
||||
) {
|
||||
|
@ -203,8 +203,8 @@ fn simd_pair_for_each_lane<'tcx, B: Backend>(
|
|||
ret: CPlace<'tcx>,
|
||||
f: impl Fn(
|
||||
&mut FunctionCx<'_, 'tcx, B>,
|
||||
TyLayout<'tcx>,
|
||||
TyLayout<'tcx>,
|
||||
TyAndLayout<'tcx>,
|
||||
TyAndLayout<'tcx>,
|
||||
Value,
|
||||
Value,
|
||||
) -> CValue<'tcx>,
|
||||
|
@ -229,7 +229,7 @@ fn simd_pair_for_each_lane<'tcx, B: Backend>(
|
|||
|
||||
fn bool_to_zero_or_max_uint<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
val: Value,
|
||||
) -> CValue<'tcx> {
|
||||
let ty = fx.clif_type(layout.ty).unwrap();
|
||||
|
|
|
@ -72,7 +72,7 @@ mod prelude {
|
|||
pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE};
|
||||
pub(crate) use rustc::mir::{self, *};
|
||||
pub(crate) use rustc_session::Session;
|
||||
pub(crate) use rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyLayout, VariantIdx};
|
||||
pub(crate) use rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyAndLayout, VariantIdx};
|
||||
pub(crate) use rustc::ty::{
|
||||
self, FnSig, Instance, InstanceDef, ParamEnv, Ty, TyCtxt, TypeAndMut, TypeFoldable,
|
||||
};
|
||||
|
|
|
@ -80,7 +80,7 @@ pub(crate) fn trap_unreachable(
|
|||
/// Trap code: user65535
|
||||
pub(crate) fn trap_unreachable_ret_value<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl cranelift_module::Backend>,
|
||||
dest_layout: TyLayout<'tcx>,
|
||||
dest_layout: TyAndLayout<'tcx>,
|
||||
msg: impl AsRef<str>,
|
||||
) -> CValue<'tcx> {
|
||||
trap_unreachable(fx, msg);
|
||||
|
@ -106,7 +106,7 @@ pub(crate) fn trap_unimplemented(
|
|||
/// Trap code: user65535
|
||||
pub(crate) fn trap_unimplemented_ret_value<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl cranelift_module::Backend>,
|
||||
dest_layout: TyLayout<'tcx>,
|
||||
dest_layout: TyAndLayout<'tcx>,
|
||||
msg: impl AsRef<str>,
|
||||
) -> CValue<'tcx> {
|
||||
trap_unimplemented(fx, msg);
|
||||
|
|
|
@ -43,8 +43,8 @@ pub(crate) fn unsized_info<'tcx>(
|
|||
fn unsize_thin_ptr<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
src: Value,
|
||||
src_layout: TyLayout<'tcx>,
|
||||
dst_layout: TyLayout<'tcx>,
|
||||
src_layout: TyAndLayout<'tcx>,
|
||||
dst_layout: TyAndLayout<'tcx>,
|
||||
) -> (Value, Value) {
|
||||
match (&src_layout.ty.kind, &dst_layout.ty.kind) {
|
||||
(&ty::Ref(_, a, _), &ty::Ref(_, b, _))
|
||||
|
@ -139,7 +139,7 @@ pub(crate) fn coerce_unsized_into<'tcx>(
|
|||
|
||||
pub(crate) fn size_and_align_of_dst<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
info: Value,
|
||||
) -> (Value, Value) {
|
||||
if !layout.is_unsized() {
|
||||
|
|
|
@ -6,9 +6,9 @@ fn codegen_field<'tcx>(
|
|||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
base: Pointer,
|
||||
extra: Option<Value>,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
field: mir::Field,
|
||||
) -> (Pointer, TyLayout<'tcx>) {
|
||||
) -> (Pointer, TyAndLayout<'tcx>) {
|
||||
let field_offset = layout.fields.offset(field.index());
|
||||
let field_layout = layout.field(&*fx, field.index());
|
||||
|
||||
|
@ -62,7 +62,7 @@ fn scalar_pair_calculate_b_offset(tcx: TyCtxt<'_>, a_scalar: &Scalar, b_scalar:
|
|||
|
||||
/// A read-only value
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub(crate) struct CValue<'tcx>(CValueInner, TyLayout<'tcx>);
|
||||
pub(crate) struct CValue<'tcx>(CValueInner, TyAndLayout<'tcx>);
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
enum CValueInner {
|
||||
|
@ -72,23 +72,23 @@ enum CValueInner {
|
|||
}
|
||||
|
||||
impl<'tcx> CValue<'tcx> {
|
||||
pub(crate) fn by_ref(ptr: Pointer, layout: TyLayout<'tcx>) -> CValue<'tcx> {
|
||||
pub(crate) fn by_ref(ptr: Pointer, layout: TyAndLayout<'tcx>) -> CValue<'tcx> {
|
||||
CValue(CValueInner::ByRef(ptr, None), layout)
|
||||
}
|
||||
|
||||
pub(crate) fn by_ref_unsized(ptr: Pointer, meta: Value, layout: TyLayout<'tcx>) -> CValue<'tcx> {
|
||||
pub(crate) fn by_ref_unsized(ptr: Pointer, meta: Value, layout: TyAndLayout<'tcx>) -> CValue<'tcx> {
|
||||
CValue(CValueInner::ByRef(ptr, Some(meta)), layout)
|
||||
}
|
||||
|
||||
pub(crate) fn by_val(value: Value, layout: TyLayout<'tcx>) -> CValue<'tcx> {
|
||||
pub(crate) fn by_val(value: Value, layout: TyAndLayout<'tcx>) -> CValue<'tcx> {
|
||||
CValue(CValueInner::ByVal(value), layout)
|
||||
}
|
||||
|
||||
pub(crate) fn by_val_pair(value: Value, extra: Value, layout: TyLayout<'tcx>) -> CValue<'tcx> {
|
||||
pub(crate) fn by_val_pair(value: Value, extra: Value, layout: TyAndLayout<'tcx>) -> CValue<'tcx> {
|
||||
CValue(CValueInner::ByValPair(value, extra), layout)
|
||||
}
|
||||
|
||||
pub(crate) fn layout(&self) -> TyLayout<'tcx> {
|
||||
pub(crate) fn layout(&self) -> TyAndLayout<'tcx> {
|
||||
self.1
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ impl<'tcx> CValue<'tcx> {
|
|||
/// If `ty` is signed, `const_val` must already be sign extended.
|
||||
pub(crate) fn const_val(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
const_val: u128,
|
||||
) -> CValue<'tcx> {
|
||||
use cranelift_codegen::ir::immediates::{Ieee32, Ieee64};
|
||||
|
@ -243,7 +243,7 @@ impl<'tcx> CValue<'tcx> {
|
|||
CValue::by_val(val, layout)
|
||||
}
|
||||
|
||||
pub(crate) fn unchecked_cast_to(self, layout: TyLayout<'tcx>) -> Self {
|
||||
pub(crate) fn unchecked_cast_to(self, layout: TyAndLayout<'tcx>) -> Self {
|
||||
CValue(self.0, layout)
|
||||
}
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ impl<'tcx> CValue<'tcx> {
|
|||
#[derive(Debug, Copy, Clone)]
|
||||
pub(crate) struct CPlace<'tcx> {
|
||||
inner: CPlaceInner,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
@ -263,7 +263,7 @@ pub(crate) enum CPlaceInner {
|
|||
}
|
||||
|
||||
impl<'tcx> CPlace<'tcx> {
|
||||
pub(crate) fn layout(&self) -> TyLayout<'tcx> {
|
||||
pub(crate) fn layout(&self) -> TyAndLayout<'tcx> {
|
||||
self.layout
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ impl<'tcx> CPlace<'tcx> {
|
|||
&self.inner
|
||||
}
|
||||
|
||||
pub(crate) fn no_place(layout: TyLayout<'tcx>) -> CPlace<'tcx> {
|
||||
pub(crate) fn no_place(layout: TyAndLayout<'tcx>) -> CPlace<'tcx> {
|
||||
CPlace {
|
||||
inner: CPlaceInner::NoPlace,
|
||||
layout,
|
||||
|
@ -280,7 +280,7 @@ impl<'tcx> CPlace<'tcx> {
|
|||
|
||||
pub(crate) fn new_stack_slot(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
) -> CPlace<'tcx> {
|
||||
assert!(!layout.is_unsized());
|
||||
if layout.size.bytes() == 0 {
|
||||
|
@ -304,7 +304,7 @@ impl<'tcx> CPlace<'tcx> {
|
|||
pub(crate) fn new_var(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
local: Local,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
) -> CPlace<'tcx> {
|
||||
fx.bcx
|
||||
.declare_var(mir_var(local), fx.clif_type(layout.ty).unwrap());
|
||||
|
@ -314,14 +314,14 @@ impl<'tcx> CPlace<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn for_ptr(ptr: Pointer, layout: TyLayout<'tcx>) -> CPlace<'tcx> {
|
||||
pub(crate) fn for_ptr(ptr: Pointer, layout: TyAndLayout<'tcx>) -> CPlace<'tcx> {
|
||||
CPlace {
|
||||
inner: CPlaceInner::Addr(ptr, None),
|
||||
layout,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn for_ptr_with_extra(ptr: Pointer, extra: Value, layout: TyLayout<'tcx>) -> CPlace<'tcx> {
|
||||
pub(crate) fn for_ptr_with_extra(ptr: Pointer, extra: Value, layout: TyAndLayout<'tcx>) -> CPlace<'tcx> {
|
||||
CPlace {
|
||||
inner: CPlaceInner::Addr(ptr, Some(extra)),
|
||||
layout,
|
||||
|
@ -578,7 +578,7 @@ impl<'tcx> CPlace<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn unchecked_cast_to(self, layout: TyLayout<'tcx>) -> Self {
|
||||
pub(crate) fn unchecked_cast_to(self, layout: TyAndLayout<'tcx>) -> Self {
|
||||
assert!(!self.layout().is_unsized());
|
||||
match self.inner {
|
||||
CPlaceInner::NoPlace => {
|
||||
|
|
|
@ -69,7 +69,7 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>(
|
|||
|
||||
pub(crate) fn get_vtable<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>,
|
||||
) -> Value {
|
||||
let data_id = if let Some(data_id) = fx.vtables.get(&(layout.ty, trait_ref)) {
|
||||
|
@ -86,7 +86,7 @@ pub(crate) fn get_vtable<'tcx>(
|
|||
|
||||
fn build_vtable<'tcx>(
|
||||
fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
|
||||
layout: TyLayout<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>,
|
||||
) -> DataId {
|
||||
let tcx = fx.tcx;
|
||||
|
|
Loading…
Add table
Reference in a new issue