mono: generate Eq functions for Boxed layout

This commit is contained in:
Brian Carroll 2022-07-03 18:42:35 +01:00
parent 817ffba982
commit 7c7e450756
No known key found for this signature in database
GPG key ID: 9CF4E3BF9C4722C7
4 changed files with 65 additions and 11 deletions

View file

@ -530,12 +530,43 @@ fn eq_tag_fields<'a>(
}
fn eq_boxed<'a>(
_root: &mut CodeGenHelp<'a>,
_ident_ids: &mut IdentIds,
_ctx: &mut Context<'a>,
_inner_layout: &'a Layout<'a>,
root: &mut CodeGenHelp<'a>,
ident_ids: &mut IdentIds,
ctx: &mut Context<'a>,
inner_layout: &'a Layout<'a>,
) -> Stmt<'a> {
todo!()
let a = root.create_symbol(ident_ids, "a");
let b = root.create_symbol(ident_ids, "b");
let result = root.create_symbol(ident_ids, "result");
let a_expr = Expr::ExprUnbox { symbol: ARG_1 };
let b_expr = Expr::ExprUnbox { symbol: ARG_2 };
let eq_call_expr = root
.call_specialized_op(ident_ids, ctx, *inner_layout, root.arena.alloc([a, b]))
.unwrap();
Stmt::Let(
a,
a_expr,
*inner_layout,
root.arena.alloc(
//
Stmt::Let(
b,
b_expr,
*inner_layout,
root.arena.alloc(
//
Stmt::Let(
result,
eq_call_expr,
LAYOUT_BOOL,
root.arena.alloc(Stmt::Ret(result)),
),
),
),
),
)
}
/// List equality