mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Update some docs and names
This commit is contained in:
parent
0b42a902ab
commit
6a6c25d32d
3 changed files with 11 additions and 11 deletions
|
@ -425,8 +425,8 @@ fn bounds_check_comparison<'ctx>(
|
||||||
builder.new_build_int_compare(IntPredicate::ULT, elem_index, len, "bounds_check")
|
builder.new_build_int_compare(IntPredicate::ULT, elem_index, len, "bounds_check")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// List.len : List * -> usize (return value will be cast to usize in user-facing API)
|
/// List.len : List * -> usize (return value will be cast to U64 in user-facing API)
|
||||||
pub(crate) fn list_len<'ctx>(
|
pub(crate) fn list_len_usize<'ctx>(
|
||||||
builder: &Builder<'ctx>,
|
builder: &Builder<'ctx>,
|
||||||
wrapper_struct: StructValue<'ctx>,
|
wrapper_struct: StructValue<'ctx>,
|
||||||
) -> IntValue<'ctx> {
|
) -> IntValue<'ctx> {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::llvm::build::{get_tag_id, tag_pointer_clear_tag_id, Env, FAST_CALL_CONV};
|
use crate::llvm::build::{get_tag_id, tag_pointer_clear_tag_id, Env, FAST_CALL_CONV};
|
||||||
use crate::llvm::build_list::{list_len, load_list_ptr};
|
use crate::llvm::build_list::{list_len_usize, load_list_ptr};
|
||||||
use crate::llvm::build_str::str_equal;
|
use crate::llvm::build_str::str_equal;
|
||||||
use crate::llvm::convert::basic_type_from_layout;
|
use crate::llvm::convert::basic_type_from_layout;
|
||||||
use bumpalo::collections::Vec;
|
use bumpalo::collections::Vec;
|
||||||
|
@ -510,8 +510,8 @@ fn build_list_eq_help<'a, 'ctx>(
|
||||||
|
|
||||||
// first, check whether the length is equal
|
// first, check whether the length is equal
|
||||||
|
|
||||||
let len1 = list_len(env.builder, list1);
|
let len1 = list_len_usize(env.builder, list1);
|
||||||
let len2 = list_len(env.builder, list2);
|
let len2 = list_len_usize(env.builder, list2);
|
||||||
|
|
||||||
let length_equal: IntValue =
|
let length_equal: IntValue =
|
||||||
env.builder
|
env.builder
|
||||||
|
|
|
@ -34,10 +34,10 @@ use crate::llvm::{
|
||||||
BuilderExt, FuncBorrowSpec, RocReturn,
|
BuilderExt, FuncBorrowSpec, RocReturn,
|
||||||
},
|
},
|
||||||
build_list::{
|
build_list::{
|
||||||
layout_width, list_append_unsafe, list_concat, list_drop_at, list_get_unsafe, list_len,
|
layout_width, list_append_unsafe, list_concat, list_drop_at, list_get_unsafe,
|
||||||
list_map, list_map2, list_map3, list_map4, list_prepend, list_release_excess_capacity,
|
list_len_usize, list_map, list_map2, list_map3, list_map4, list_prepend,
|
||||||
list_replace_unsafe, list_reserve, list_sort_with, list_sublist, list_swap,
|
list_release_excess_capacity, list_replace_unsafe, list_reserve, list_sort_with,
|
||||||
list_symbol_to_c_abi, list_with_capacity, pass_update_mode,
|
list_sublist, list_swap, list_symbol_to_c_abi, list_with_capacity, pass_update_mode,
|
||||||
},
|
},
|
||||||
compare::{generic_eq, generic_neq},
|
compare::{generic_eq, generic_neq},
|
||||||
convert::{
|
convert::{
|
||||||
|
@ -621,7 +621,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
||||||
// List.len : List * -> U64
|
// List.len : List * -> U64
|
||||||
arguments!(list);
|
arguments!(list);
|
||||||
|
|
||||||
let len_usize = list_len(env.builder, list.into_struct_value());
|
let len_usize = list_len_usize(env.builder, list.into_struct_value());
|
||||||
|
|
||||||
// List.len returns U64, although length is stored as usize
|
// List.len returns U64, although length is stored as usize
|
||||||
env.builder
|
env.builder
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue