mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
helper for generating dec
functions
This commit is contained in:
parent
13e52844c7
commit
f383ff14f8
2 changed files with 28 additions and 0 deletions
|
@ -1653,6 +1653,32 @@ impl<
|
|||
)
|
||||
}
|
||||
|
||||
fn gen_refcount_proc_dec(&mut self, layout: InLayout<'a>) -> Symbol {
|
||||
let ident_ids = self
|
||||
.interns
|
||||
.all_ident_ids
|
||||
.get_mut(&self.env.module_id)
|
||||
.unwrap();
|
||||
|
||||
let (refcount_proc_name, _) = self.helper_proc_gen.gen_refcount_proc(
|
||||
ident_ids,
|
||||
self.layout_interner,
|
||||
layout,
|
||||
HelperOp::Dec,
|
||||
);
|
||||
|
||||
let proc_layout = ProcLayout {
|
||||
arguments: self.env().arena.alloc([layout]),
|
||||
result: Layout::UNIT,
|
||||
niche: roc_mono::layout::Niche::NONE,
|
||||
};
|
||||
|
||||
self.helper_proc_symbols_mut()
|
||||
.push((refcount_proc_name, proc_layout));
|
||||
|
||||
refcount_proc_name
|
||||
}
|
||||
|
||||
fn build_higher_order_lowlevel(
|
||||
&mut self,
|
||||
dst: &Symbol,
|
||||
|
|
|
@ -1609,6 +1609,8 @@ trait Backend<'a> {
|
|||
ret_layout: InLayout<'a>,
|
||||
);
|
||||
|
||||
fn gen_refcount_proc_dec(&mut self, layout: InLayout<'a>) -> Symbol;
|
||||
|
||||
/// build_list_with_capacity creates and returns a list with the given capacity.
|
||||
fn build_list_with_capacity(
|
||||
&mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue