simplify/optimize decref logic

This commit is contained in:
Folkert 2021-09-01 23:07:56 +02:00
parent 7aac6b6750
commit 4e39543054
2 changed files with 16 additions and 40 deletions

View file

@ -220,18 +220,14 @@ impl<'ctx> PointerToRefcount<'ctx> {
let alignment = env.context.i32_type().const_int(alignment as _, false);
// has to be non-zero, or the deallocation is skipped
let data_bytes = env.ptr_int().const_int(1, false);
call_void_bitcode_fn(
env,
&[
env.builder.build_bitcast(
parent.get_nth_param(0).unwrap(),
env.context.i8_type().ptr_type(AddressSpace::Generic),
env.ptr_int().ptr_type(AddressSpace::Generic),
"foo",
),
data_bytes.into(),
alignment.into(),
],
roc_builtins::bitcode::UTILS_DECREF,