use ptr_int

This commit is contained in:
Folkert 2021-07-24 12:43:58 +02:00
parent d0be0df83c
commit f5e5ec42ad

View file

@ -138,9 +138,11 @@ pub fn list_prepend<'a, 'ctx, 'env>(
let list_ptr = load_list_ptr(builder, original_wrapper, ptr_type); let list_ptr = load_list_ptr(builder, original_wrapper, ptr_type);
// The output list length, which is the old list length + 1 // The output list length, which is the old list length + 1
let new_list_len = let new_list_len = env.builder.build_int_add(
env.builder env.ptr_int().const_int(1_u64, false),
.build_int_add(env.ptr_int.const_int(1_u64, false), len, "new_list_length"); len,
"new_list_length",
);
// Allocate space for the new array that we'll copy into. // Allocate space for the new array that we'll copy into.
let clone_ptr = allocate_list(env, elem_layout, new_list_len); let clone_ptr = allocate_list(env, elem_layout, new_list_len);
@ -150,7 +152,7 @@ pub fn list_prepend<'a, 'ctx, 'env>(
let index_1_ptr = unsafe { let index_1_ptr = unsafe {
builder.build_in_bounds_gep( builder.build_in_bounds_gep(
clone_ptr, clone_ptr,
&[env.ptr_int.const_int(1_u64, false)], &[env.ptr_int().const_int(1_u64, false)],
"load_index", "load_index",
) )
}; };