Add List.concat implementation for generic64

This commit is contained in:
Ahmad Sattar 2023-01-28 02:07:38 +01:00
parent a1e2c3f64b
commit f6b8a27955
No known key found for this signature in database
GPG key ID: 6EAC5AB400A49604
3 changed files with 104 additions and 9 deletions

View file

@ -727,6 +727,15 @@ trait Backend<'a> {
);
self.build_list_replace_unsafe(sym, args, arg_layouts, ret_layout)
}
LowLevel::ListConcat => {
debug_assert_eq!(
2,
args.len(),
"ListConcat: expected to have exactly two arguments"
);
let element_layout = list_element_layout!(self.interner(), *ret_layout);
self.build_list_concat(sym, args, arg_layouts, element_layout, ret_layout)
}
LowLevel::StrConcat => self.build_fn_call(
sym,
bitcode::STR_CONCAT.to_string(),
@ -996,6 +1005,16 @@ trait Backend<'a> {
ret_layout: &InLayout<'a>,
);
/// build_list_concat returns a new list containing the two argument lists concatenated.
fn build_list_concat(
&mut self,
dst: &Symbol,
args: &'a [Symbol],
arg_layouts: &[InLayout<'a>],
element_layout: InLayout<'a>,
ret_layout: &InLayout<'a>,
);
/// build_refcount_getptr loads the pointer to the reference count of src into dst.
fn build_ptr_cast(&mut self, dst: &Symbol, src: &Symbol);