Avoid splitting up a layout
This commit is contained in:
@@ -370,9 +370,9 @@ fn build_single_variant_union_fields<'ll, 'tcx>(
|
||||
cx,
|
||||
enum_type_di_node,
|
||||
&variant_union_field_name(variant_index),
|
||||
// NOTE: We use the size and align of the entire type, not from variant_layout
|
||||
// NOTE: We use the layout of the entire type, not from variant_layout
|
||||
// since the later is sometimes smaller (if it has fewer fields).
|
||||
size_and_align_of(enum_type_and_layout),
|
||||
enum_type_and_layout,
|
||||
Size::ZERO,
|
||||
visibility_flags,
|
||||
variant_struct_type_wrapper_di_node,
|
||||
@@ -560,7 +560,7 @@ fn build_variant_struct_wrapper_type_di_node<'ll, 'tcx>(
|
||||
cx,
|
||||
wrapper_struct_type_di_node,
|
||||
"value",
|
||||
size_and_align_of(enum_or_coroutine_type_and_layout),
|
||||
enum_or_coroutine_type_and_layout,
|
||||
Size::ZERO,
|
||||
DIFlags::FlagZero,
|
||||
variant_struct_type_di_node,
|
||||
@@ -874,7 +874,7 @@ fn build_union_fields_for_direct_tag_enum_or_coroutine<'ll, 'tcx>(
|
||||
|
||||
if is_128_bits {
|
||||
let type_di_node = type_di_node(cx, cx.tcx.types.u64);
|
||||
let size_and_align = cx.size_and_align_of(cx.tcx.types.u64);
|
||||
let u64_layout = cx.layout_of(cx.tcx.types.u64);
|
||||
|
||||
let (lo_offset, hi_offset) = match cx.tcx.data_layout.endian {
|
||||
Endian::Little => (0, 8),
|
||||
@@ -889,7 +889,7 @@ fn build_union_fields_for_direct_tag_enum_or_coroutine<'ll, 'tcx>(
|
||||
cx,
|
||||
enum_type_di_node,
|
||||
TAG_FIELD_NAME_128_LO,
|
||||
size_and_align,
|
||||
u64_layout,
|
||||
lo_offset,
|
||||
di_flags,
|
||||
type_di_node,
|
||||
@@ -900,7 +900,7 @@ fn build_union_fields_for_direct_tag_enum_or_coroutine<'ll, 'tcx>(
|
||||
cx,
|
||||
enum_type_di_node,
|
||||
TAG_FIELD_NAME_128_HI,
|
||||
size_and_align,
|
||||
u64_layout,
|
||||
hi_offset,
|
||||
DIFlags::FlagZero,
|
||||
type_di_node,
|
||||
@@ -911,7 +911,7 @@ fn build_union_fields_for_direct_tag_enum_or_coroutine<'ll, 'tcx>(
|
||||
cx,
|
||||
enum_type_di_node,
|
||||
TAG_FIELD_NAME,
|
||||
cx.size_and_align_of(enum_type_and_layout.field(cx, tag_field).ty),
|
||||
enum_type_and_layout.field(cx, tag_field),
|
||||
enum_type_and_layout.fields.offset(tag_field),
|
||||
di_flags,
|
||||
tag_base_type_di_node,
|
||||
|
||||
@@ -249,7 +249,7 @@ fn build_enum_variant_struct_type_di_node<'ll, 'tcx>(
|
||||
cx,
|
||||
struct_type_di_node,
|
||||
&field_name,
|
||||
(field_layout.size, field_layout.align.abi),
|
||||
field_layout,
|
||||
variant_layout.fields.offset(field_index),
|
||||
di_flags,
|
||||
type_di_node(cx, field_layout.ty),
|
||||
@@ -332,7 +332,7 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
|
||||
cx,
|
||||
variant_struct_type_di_node,
|
||||
&field_name,
|
||||
cx.size_and_align_of(field_type),
|
||||
cx.layout_of(field_type),
|
||||
variant_layout.fields.offset(field_index),
|
||||
DIFlags::FlagZero,
|
||||
type_di_node(cx, field_type),
|
||||
@@ -352,7 +352,7 @@ fn build_coroutine_variant_struct_type_di_node<'ll, 'tcx>(
|
||||
cx,
|
||||
variant_struct_type_di_node,
|
||||
upvar_name.as_str(),
|
||||
cx.size_and_align_of(upvar_ty),
|
||||
cx.layout_of(upvar_ty),
|
||||
coroutine_type_and_layout.fields.offset(index),
|
||||
DIFlags::FlagZero,
|
||||
type_di_node(cx, upvar_ty),
|
||||
|
||||
Reference in New Issue
Block a user