Convert LayoutRepr::Struct into a tuple variant

This commit is contained in:
Ayaz Hafiz 2023-05-10 16:41:13 -05:00
parent a6bda6eccf
commit a67c148be7
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
24 changed files with 85 additions and 128 deletions

View file

@ -35,9 +35,7 @@ pub fn eq_generic<'a>(
unreachable!("No generated helper proc for `==` on Str. Use Zig function.")
}
Builtin(List(elem_layout)) => eq_list(root, ident_ids, ctx, layout_interner, elem_layout),
Struct { field_layouts, .. } => {
eq_struct(root, ident_ids, ctx, layout_interner, field_layouts)
}
Struct(field_layouts) => eq_struct(root, ident_ids, ctx, layout_interner, field_layouts),
Union(union_layout) => eq_tag_union(root, ident_ids, ctx, layout_interner, union_layout),
Boxed(inner_layout) => eq_boxed(root, ident_ids, ctx, layout_interner, inner_layout),
LambdaSet(_) => unreachable!("`==` is not defined on functions"),

View file

@ -541,14 +541,12 @@ impl<'a> CodeGenHelp<'a> {
LayoutRepr::Builtin(_) => return layout,
LayoutRepr::Struct { field_layouts } => {
LayoutRepr::Struct(field_layouts) => {
let mut new_field_layouts = Vec::with_capacity_in(field_layouts.len(), self.arena);
for f in field_layouts.iter() {
new_field_layouts.push(self.replace_rec_ptr(ctx, layout_interner, *f));
}
LayoutRepr::Struct {
field_layouts: new_field_layouts.into_bump_slice(),
}
LayoutRepr::Struct(new_field_layouts.into_bump_slice())
}
LayoutRepr::Union(UnionLayout::NonRecursive(tags)) => {

View file

@ -199,7 +199,7 @@ pub fn refcount_generic<'a>(
elem_layout,
structure,
),
LayoutRepr::Struct { field_layouts, .. } => refcount_struct(
LayoutRepr::Struct(field_layouts) => refcount_struct(
root,
ident_ids,
ctx,