mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
groundwork for RoseTree
This commit is contained in:
parent
a4d7e809d2
commit
513d7cd78f
9 changed files with 304 additions and 29 deletions
|
@ -359,6 +359,18 @@ pub fn decrement_refcount_layout<'a, 'ctx, 'env>(
|
|||
build_dec_rec_union(env, layout_ids, tags, value.into_pointer_value(), true);
|
||||
}
|
||||
|
||||
NonNullableUnwrapped(fields) => {
|
||||
debug_assert!(value.is_pointer_value());
|
||||
|
||||
build_dec_rec_union(
|
||||
env,
|
||||
layout_ids,
|
||||
&*env.arena.alloc([*fields]),
|
||||
value.into_pointer_value(),
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
NullableUnwrapped { other_fields, .. } => {
|
||||
debug_assert!(value.is_pointer_value());
|
||||
|
||||
|
@ -484,6 +496,18 @@ pub fn increment_refcount_layout<'a, 'ctx, 'env>(
|
|||
);
|
||||
}
|
||||
|
||||
NonNullableUnwrapped(fields) => {
|
||||
debug_assert!(value.is_pointer_value());
|
||||
|
||||
build_inc_rec_union(
|
||||
env,
|
||||
layout_ids,
|
||||
&*env.arena.alloc([*fields]),
|
||||
value.into_pointer_value(),
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
Recursive(tags) => {
|
||||
debug_assert!(value.is_pointer_value());
|
||||
build_inc_rec_union(env, layout_ids, tags, value.into_pointer_value(), false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue