Put the capture niche in the lambda name instead of generating new names

This commit is contained in:
Ayaz Hafiz 2022-07-01 15:52:36 -04:00 committed by ayazhafiz
parent 1ed2e1a8e9
commit 019ebd93f7
No known key found for this signature in database
GPG key ID: B443F7A3030C9AED
20 changed files with 592 additions and 486 deletions

View file

@ -170,7 +170,7 @@ impl<'a> CodeGenHelp<'a> {
let arg_layouts = self.arena.alloc([layout]);
let expr = Expr::Call(Call {
call_type: CallType::ByName {
name: proc_name,
name: LambdaName::only_receiver(proc_name),
ret_layout,
arg_layouts,
specialization_id: CallSpecId::BACKEND_DUMMY,
@ -262,7 +262,7 @@ impl<'a> CodeGenHelp<'a> {
Some(Expr::Call(Call {
call_type: CallType::ByName {
name: proc_name,
name: LambdaName::only_receiver(proc_name),
ret_layout,
arg_layouts,
specialization_id: CallSpecId::BACKEND_DUMMY,
@ -375,19 +375,23 @@ impl<'a> CodeGenHelp<'a> {
HelperOp::Inc => ProcLayout {
arguments: self.arena.alloc([*layout, self.layout_isize]),
result: LAYOUT_UNIT,
captures_niche: &[],
},
HelperOp::Dec => ProcLayout {
arguments: self.arena.alloc([*layout]),
result: LAYOUT_UNIT,
captures_niche: &[],
},
HelperOp::Reset => ProcLayout {
arguments: self.arena.alloc([*layout]),
result: *layout,
captures_niche: &[],
},
HelperOp::DecRef(_) => unreachable!("No generated Proc for DecRef"),
HelperOp::Eq => ProcLayout {
arguments: self.arena.alloc([*layout, *layout]),
result: LAYOUT_BOOL,
captures_niche: &[],
},
};