mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
add LayoutRepr::Ptr
This commit is contained in:
parent
a9f7961b52
commit
17512873e8
18 changed files with 62 additions and 8 deletions
|
@ -38,6 +38,7 @@ pub fn eq_generic<'a>(
|
|||
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),
|
||||
Ptr(inner_layout) => eq_boxed(root, ident_ids, ctx, layout_interner, inner_layout),
|
||||
LambdaSet(_) => unreachable!("`==` is not defined on functions"),
|
||||
RecursivePointer(_) => {
|
||||
unreachable!(
|
||||
|
|
|
@ -577,6 +577,11 @@ impl<'a> CodeGenHelp<'a> {
|
|||
LayoutRepr::Boxed(inner)
|
||||
}
|
||||
|
||||
LayoutRepr::Ptr(inner) => {
|
||||
let inner = self.replace_rec_ptr(ctx, layout_interner, inner);
|
||||
LayoutRepr::Ptr(inner)
|
||||
}
|
||||
|
||||
LayoutRepr::LambdaSet(lambda_set) => {
|
||||
return self.replace_rec_ptr(ctx, layout_interner, lambda_set.representation)
|
||||
}
|
||||
|
@ -844,5 +849,6 @@ fn layout_needs_helper_proc<'a>(
|
|||
LayoutRepr::LambdaSet(_) => true,
|
||||
LayoutRepr::RecursivePointer(_) => false,
|
||||
LayoutRepr::Boxed(_) => true,
|
||||
LayoutRepr::Ptr(_) => false,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,6 +239,9 @@ pub fn refcount_generic<'a>(
|
|||
inner_layout,
|
||||
structure,
|
||||
),
|
||||
LayoutRepr::Ptr(_) => {
|
||||
unreachable!("We should never call a refcounting helper on a Ptr layout directly")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue