mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
tweaks
This commit is contained in:
parent
59e551dd32
commit
d0be0df83c
3 changed files with 5 additions and 9 deletions
|
@ -2827,7 +2827,7 @@ fn build_switch_ir<'a, 'ctx, 'env>(
|
|||
.into_int_value()
|
||||
}
|
||||
Layout::Union(variant) => {
|
||||
cond_layout = Layout::Builtin(Builtin::Int64);
|
||||
cond_layout = variant.tag_id_layout();
|
||||
|
||||
get_tag_id(env, parent, &variant, cond_value)
|
||||
}
|
||||
|
|
|
@ -138,11 +138,9 @@ pub fn list_prepend<'a, 'ctx, 'env>(
|
|||
let list_ptr = load_list_ptr(builder, original_wrapper, ptr_type);
|
||||
|
||||
// The output list length, which is the old list length + 1
|
||||
let new_list_len = env.builder.build_int_add(
|
||||
ctx.i64_type().const_int(1_u64, false),
|
||||
len,
|
||||
"new_list_length",
|
||||
);
|
||||
let new_list_len =
|
||||
env.builder
|
||||
.build_int_add(env.ptr_int.const_int(1_u64, false), len, "new_list_length");
|
||||
|
||||
// Allocate space for the new array that we'll copy into.
|
||||
let clone_ptr = allocate_list(env, elem_layout, new_list_len);
|
||||
|
@ -152,7 +150,7 @@ pub fn list_prepend<'a, 'ctx, 'env>(
|
|||
let index_1_ptr = unsafe {
|
||||
builder.build_in_bounds_gep(
|
||||
clone_ptr,
|
||||
&[ctx.i64_type().const_int(1_u64, false)],
|
||||
&[env.ptr_int.const_int(1_u64, false)],
|
||||
"load_index",
|
||||
)
|
||||
};
|
||||
|
|
|
@ -247,8 +247,6 @@ fn insert_reset<'a>(
|
|||
|
||||
let reset_expr = Expr::Reset(x);
|
||||
|
||||
// const I64: Layout<'static> = Layout::Builtin(crate::layout::Builtin::Int64);
|
||||
|
||||
let layout = Layout::Union(union_layout);
|
||||
|
||||
stmt = env.arena.alloc(Stmt::Let(w, reset_expr, layout, stmt));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue