mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
cleanup
This commit is contained in:
parent
d8fd2d670d
commit
bb12b39fc7
1 changed files with 13 additions and 13 deletions
|
@ -705,7 +705,7 @@ fn modify_refcount_str_help<'a, 'ctx, 'env>(
|
||||||
IntPredicate::SGT,
|
IntPredicate::SGT,
|
||||||
len,
|
len,
|
||||||
ptr_int(ctx, env.ptr_bytes).const_zero(),
|
ptr_int(ctx, env.ptr_bytes).const_zero(),
|
||||||
"len > 0",
|
"is_big_str",
|
||||||
);
|
);
|
||||||
|
|
||||||
// the block we'll always jump to when we're done
|
// the block we'll always jump to when we're done
|
||||||
|
@ -928,10 +928,6 @@ fn build_rec_union_help<'a, 'ctx, 'env>(
|
||||||
// next, make a jump table for all possible values of the tag_id
|
// next, make a jump table for all possible values of the tag_id
|
||||||
let mut cases = Vec::with_capacity_in(tags.len(), env.arena);
|
let mut cases = Vec::with_capacity_in(tags.len(), env.arena);
|
||||||
|
|
||||||
let merge_block = env
|
|
||||||
.context
|
|
||||||
.append_basic_block(parent, pick("increment_merge", "decrement_merge"));
|
|
||||||
|
|
||||||
builder.set_current_debug_location(&context, loc);
|
builder.set_current_debug_location(&context, loc);
|
||||||
|
|
||||||
for (tag_id, field_layouts) in tags.iter().enumerate() {
|
for (tag_id, field_layouts) in tags.iter().enumerate() {
|
||||||
|
@ -1052,18 +1048,22 @@ fn build_rec_union_help<'a, 'ctx, 'env>(
|
||||||
// read the tag_id
|
// read the tag_id
|
||||||
let current_tag_id = rec_union_read_tag(env, value_ptr);
|
let current_tag_id = rec_union_read_tag(env, value_ptr);
|
||||||
|
|
||||||
|
let merge_block = env
|
||||||
|
.context
|
||||||
|
.append_basic_block(parent, pick("increment_merge", "decrement_merge"));
|
||||||
|
|
||||||
// switch on it
|
// switch on it
|
||||||
env.builder
|
env.builder
|
||||||
.build_switch(current_tag_id, merge_block, &cases);
|
.build_switch(current_tag_id, merge_block, &cases);
|
||||||
|
|
||||||
|
env.builder.position_at_end(merge_block);
|
||||||
|
|
||||||
|
// increment/decrement the cons-cell itself
|
||||||
|
refcount_ptr.modify(call_mode, &layout, env);
|
||||||
|
|
||||||
|
// this function returns void
|
||||||
|
builder.build_return(None);
|
||||||
}
|
}
|
||||||
|
|
||||||
env.builder.position_at_end(merge_block);
|
|
||||||
|
|
||||||
// increment/decrement the cons-cell itself
|
|
||||||
refcount_ptr.modify(call_mode, &layout, env);
|
|
||||||
|
|
||||||
// this function returns void
|
|
||||||
builder.build_return(None);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rec_union_read_tag<'a, 'ctx, 'env>(
|
fn rec_union_read_tag<'a, 'ctx, 'env>(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue