mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
remove dict/set layout
This commit is contained in:
parent
5aef349f09
commit
4d55b756bb
16 changed files with 8 additions and 321 deletions
|
@ -30,7 +30,6 @@ pub fn eq_generic<'a>(
|
|||
Layout::Builtin(Builtin::Str) => {
|
||||
unreachable!("No generated helper proc for `==` on Str. Use Zig function.")
|
||||
}
|
||||
Layout::Builtin(Builtin::Dict(_, _) | Builtin::Set(_)) => eq_todo(),
|
||||
Layout::Builtin(Builtin::List(elem_layout)) => eq_list(root, ident_ids, ctx, elem_layout),
|
||||
Layout::Struct { field_layouts, .. } => eq_struct(root, ident_ids, ctx, field_layouts),
|
||||
Layout::Union(union_layout) => eq_tag_union(root, ident_ids, ctx, union_layout),
|
||||
|
|
|
@ -410,15 +410,6 @@ impl<'a> CodeGenHelp<'a> {
|
|||
// needs *two* specializations for `List(RecursivePointer)`, not just one.
|
||||
fn replace_rec_ptr(&self, ctx: &Context<'a>, layout: Layout<'a>) -> Layout<'a> {
|
||||
match layout {
|
||||
Layout::Builtin(Builtin::Dict(k, v)) => Layout::Builtin(Builtin::Dict(
|
||||
self.arena.alloc(self.replace_rec_ptr(ctx, *k)),
|
||||
self.arena.alloc(self.replace_rec_ptr(ctx, *v)),
|
||||
)),
|
||||
|
||||
Layout::Builtin(Builtin::Set(k)) => Layout::Builtin(Builtin::Set(
|
||||
self.arena.alloc(self.replace_rec_ptr(ctx, *k)),
|
||||
)),
|
||||
|
||||
Layout::Builtin(Builtin::List(v)) => Layout::Builtin(Builtin::List(
|
||||
self.arena.alloc(self.replace_rec_ptr(ctx, *v)),
|
||||
)),
|
||||
|
@ -543,7 +534,7 @@ fn layout_needs_helper_proc(layout: &Layout, op: HelperOp) -> bool {
|
|||
// Both are fine, they were just developed at different times.
|
||||
matches!(op, HelperOp::Inc | HelperOp::Dec | HelperOp::DecRef(_))
|
||||
}
|
||||
Layout::Builtin(Builtin::Dict(_, _) | Builtin::Set(_) | Builtin::List(_)) => true,
|
||||
Layout::Builtin(Builtin::List(_)) => true,
|
||||
Layout::Struct { .. } => true, // note: we do generate a helper for Unit, with just a Stmt::Ret
|
||||
Layout::Union(UnionLayout::NonRecursive(tags)) => !tags.is_empty(),
|
||||
Layout::Union(_) => true,
|
||||
|
|
|
@ -115,7 +115,6 @@ pub fn refcount_generic<'a>(
|
|||
Layout::Builtin(Builtin::List(elem_layout)) => {
|
||||
refcount_list(root, ident_ids, ctx, &layout, elem_layout, structure)
|
||||
}
|
||||
Layout::Builtin(Builtin::Dict(_, _) | Builtin::Set(_)) => rc_todo(),
|
||||
Layout::Struct { field_layouts, .. } => {
|
||||
refcount_struct(root, ident_ids, ctx, field_layouts, structure)
|
||||
}
|
||||
|
@ -322,7 +321,6 @@ pub fn is_rc_implemented_yet(layout: &Layout) -> bool {
|
|||
use UnionLayout::*;
|
||||
|
||||
match layout {
|
||||
Layout::Builtin(Builtin::Dict(..) | Builtin::Set(_)) => false,
|
||||
Layout::Builtin(Builtin::List(elem_layout)) => is_rc_implemented_yet(elem_layout),
|
||||
Layout::Builtin(_) => true,
|
||||
Layout::Struct { field_layouts, .. } => field_layouts.iter().all(is_rc_implemented_yet),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue