mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-10 22:06:17 +00:00
Revert "Remove obsolete ListLenUsize"
This reverts commit ad1bca4ac9c40d336522f944df60d61a814435dd.
This commit is contained in:
parent
87d4760356
commit
739565e836
16 changed files with 64 additions and 29 deletions
|
@ -1484,13 +1484,21 @@ trait Backend<'a> {
|
|||
|
||||
self.build_fn_call(sym, intrinsic.to_string(), args, arg_layouts, ret_layout)
|
||||
}
|
||||
LowLevel::ListLen => {
|
||||
LowLevel::ListLenU64 => {
|
||||
debug_assert_eq!(
|
||||
1,
|
||||
args.len(),
|
||||
"ListLenU64: expected to have exactly one argument"
|
||||
);
|
||||
self.build_list_len(sym, &args[0])
|
||||
self.build_list_len_u64(sym, &args[0])
|
||||
}
|
||||
LowLevel::ListLenUsize => {
|
||||
debug_assert_eq!(
|
||||
1,
|
||||
args.len(),
|
||||
"ListLenUsize: expected to have exactly one argument"
|
||||
);
|
||||
self.build_list_len_usize(sym, &args[0])
|
||||
}
|
||||
LowLevel::ListWithCapacity => {
|
||||
debug_assert_eq!(
|
||||
|
@ -2374,8 +2382,11 @@ trait Backend<'a> {
|
|||
/// build_sqrt stores the result of `sqrt(src)` into dst.
|
||||
fn build_num_sqrt(&mut self, dst: Symbol, src: Symbol, float_width: FloatWidth);
|
||||
|
||||
/// build_list_len returns the length of a list after casting it from usize to u64.
|
||||
fn build_list_len(&mut self, dst: &Symbol, list: &Symbol);
|
||||
/// build_list_len_usize returns the length of a list as a usize. This is for internal use only.
|
||||
fn build_list_len_usize(&mut self, dst: &Symbol, list: &Symbol);
|
||||
|
||||
/// build_list_len_u64 returns the length of a list and casts it from usize to u64. This is for the public List.len.
|
||||
fn build_list_len_u64(&mut self, dst: &Symbol, list: &Symbol);
|
||||
|
||||
/// generate a call to a higher-order lowlevel
|
||||
fn build_higher_order_lowlevel(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue