mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-28 20:16:58 +03:00
Auto merge of #147145 - Zalathar:rollup-s7kcs3w, r=Zalathar
Rollup of 3 pull requests Successful merges: - rust-lang/rust#147100 (tests: Remove ignore-android directive for fixed issue) - rust-lang/rust#147116 (compiler: remove AbiAlign inside TargetDataLayout) - rust-lang/rust#147134 (remove explicit deref of AbiAlign for most methods) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@ pub(super) fn add_local_place_comments<'tcx>(
|
||||
format!("{:?}", local),
|
||||
format!("{:?}", ty),
|
||||
size.bytes(),
|
||||
align.abi.bytes(),
|
||||
align.bytes(),
|
||||
if extra.is_empty() { "" } else { " " },
|
||||
extra,
|
||||
));
|
||||
|
||||
@@ -233,7 +233,7 @@ pub(super) fn from_casted_value<'tcx>(
|
||||
// It may also be smaller for example when the type is a wrapper around an integer with a
|
||||
// larger alignment than the integer.
|
||||
std::cmp::max(abi_param_size, layout_size),
|
||||
u32::try_from(layout.align.abi.bytes()).unwrap(),
|
||||
u32::try_from(layout.align.bytes()).unwrap(),
|
||||
);
|
||||
let mut block_params_iter = block_params.iter().copied();
|
||||
for (offset, _) in abi_params {
|
||||
|
||||
+1
-1
@@ -846,7 +846,7 @@ fn is_wide_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
let layout = fx.layout_of(fx.monomorphize(ty));
|
||||
let val = match null_op {
|
||||
NullOp::SizeOf => layout.size.bytes(),
|
||||
NullOp::AlignOf => layout.align.abi.bytes(),
|
||||
NullOp::AlignOf => layout.align.bytes(),
|
||||
NullOp::OffsetOf(fields) => fx
|
||||
.tcx
|
||||
.offset_of_subfield(
|
||||
|
||||
@@ -304,7 +304,7 @@ pub(crate) fn define_static<'tcx>(
|
||||
entry.set(gimli::DW_AT_decl_file, AttributeValue::FileIndex(Some(file_id)));
|
||||
entry.set(gimli::DW_AT_decl_line, AttributeValue::Udata(line));
|
||||
|
||||
entry.set(gimli::DW_AT_alignment, AttributeValue::Udata(static_layout.align.abi.bytes()));
|
||||
entry.set(gimli::DW_AT_alignment, AttributeValue::Udata(static_layout.align.bytes()));
|
||||
|
||||
let mut expr = Expression::new();
|
||||
expr.op_addr(address_for_data(data_id));
|
||||
|
||||
@@ -166,7 +166,7 @@ fn tuple_type<'tcx>(
|
||||
let tuple_entry = self.dwarf.unit.get_mut(tuple_type_id);
|
||||
tuple_entry.set(gimli::DW_AT_name, AttributeValue::StringRef(self.dwarf.strings.add(name)));
|
||||
tuple_entry.set(gimli::DW_AT_byte_size, AttributeValue::Udata(layout.size.bytes()));
|
||||
tuple_entry.set(gimli::DW_AT_alignment, AttributeValue::Udata(layout.align.abi.bytes()));
|
||||
tuple_entry.set(gimli::DW_AT_alignment, AttributeValue::Udata(layout.align.bytes()));
|
||||
|
||||
for (i, (ty, dw_ty)) in components.into_iter().enumerate() {
|
||||
let member_id = self.dwarf.unit.add(tuple_type_id, gimli::DW_TAG_member);
|
||||
@@ -178,9 +178,7 @@ fn tuple_type<'tcx>(
|
||||
member_entry.set(gimli::DW_AT_type, AttributeValue::UnitRef(dw_ty));
|
||||
member_entry.set(
|
||||
gimli::DW_AT_alignment,
|
||||
AttributeValue::Udata(
|
||||
FullyMonomorphizedLayoutCx(tcx).layout_of(ty).align.abi.bytes(),
|
||||
),
|
||||
AttributeValue::Udata(FullyMonomorphizedLayoutCx(tcx).layout_of(ty).align.bytes()),
|
||||
);
|
||||
member_entry.set(
|
||||
gimli::DW_AT_data_member_location,
|
||||
|
||||
+3
-3
@@ -167,7 +167,7 @@ pub(crate) fn size_and_align_of<'tcx>(
|
||||
if layout.is_sized() {
|
||||
return (
|
||||
fx.bcx.ins().iconst(fx.pointer_type, layout.size.bytes() as i64),
|
||||
fx.bcx.ins().iconst(fx.pointer_type, layout.align.abi.bytes() as i64),
|
||||
fx.bcx.ins().iconst(fx.pointer_type, layout.align.bytes() as i64),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ pub(crate) fn size_and_align_of<'tcx>(
|
||||
// times the unit size.
|
||||
(
|
||||
fx.bcx.ins().imul_imm(info.unwrap(), unit.size.bytes() as i64),
|
||||
fx.bcx.ins().iconst(fx.pointer_type, unit.align.abi.bytes() as i64),
|
||||
fx.bcx.ins().iconst(fx.pointer_type, unit.align.bytes() as i64),
|
||||
)
|
||||
}
|
||||
ty::Foreign(_) => {
|
||||
@@ -224,7 +224,7 @@ pub(crate) fn size_and_align_of<'tcx>(
|
||||
let unsized_offset_unadjusted = layout.fields.offset(i).bytes();
|
||||
let unsized_offset_unadjusted =
|
||||
fx.bcx.ins().iconst(fx.pointer_type, unsized_offset_unadjusted as i64);
|
||||
let sized_align = layout.align.abi.bytes();
|
||||
let sized_align = layout.align.bytes();
|
||||
let sized_align = fx.bcx.ins().iconst(fx.pointer_type, sized_align as i64);
|
||||
|
||||
// Recurse to get the size of the dynamically sized field (must be
|
||||
|
||||
@@ -383,7 +383,7 @@ pub(crate) fn new_stack_slot(
|
||||
|
||||
let stack_slot = fx.create_stack_slot(
|
||||
u32::try_from(layout.size.bytes()).unwrap(),
|
||||
u32::try_from(layout.align.abi.bytes()).unwrap(),
|
||||
u32::try_from(layout.align.bytes()).unwrap(),
|
||||
);
|
||||
CPlace { inner: CPlaceInner::Addr(stack_slot, None), layout }
|
||||
}
|
||||
@@ -641,8 +641,8 @@ fn transmute_scalar<'tcx>(
|
||||
let size = dst_layout.size.bytes();
|
||||
// `emit_small_memory_copy` uses `u8` for alignments, just use the maximum
|
||||
// alignment that fits in a `u8` if the actual alignment is larger.
|
||||
let src_align = src_layout.align.abi.bytes().try_into().unwrap_or(128);
|
||||
let dst_align = dst_layout.align.abi.bytes().try_into().unwrap_or(128);
|
||||
let src_align = src_layout.align.bytes().try_into().unwrap_or(128);
|
||||
let dst_align = dst_layout.align.bytes().try_into().unwrap_or(128);
|
||||
fx.bcx.emit_small_memory_copy(
|
||||
fx.target_config,
|
||||
to_addr,
|
||||
|
||||
Reference in New Issue
Block a user