mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00
unwrap lambda sets for RC
This commit is contained in:
parent
81b4b3d22c
commit
ce640fe65f
2 changed files with 13 additions and 10 deletions
|
@ -2872,7 +2872,7 @@ pub(crate) fn build_exp_stmt<'a, 'ctx>(
|
|||
DecRef(symbol) => {
|
||||
let (value, layout) = scope.load_symbol_and_layout(symbol);
|
||||
|
||||
match layout_interner.get_repr(layout) {
|
||||
match layout_interner.runtime_representation(layout) {
|
||||
LayoutRepr::Builtin(Builtin::Str) => todo!(),
|
||||
LayoutRepr::Builtin(Builtin::List(element_layout)) => {
|
||||
debug_assert!(value.is_struct_value());
|
||||
|
@ -2884,14 +2884,17 @@ pub(crate) fn build_exp_stmt<'a, 'ctx>(
|
|||
|
||||
other_layout if other_layout.is_refcounted(layout_interner) => {
|
||||
if value.is_pointer_value() {
|
||||
let value_ptr = match other_layout {
|
||||
LayoutRepr::Union(union_layout)
|
||||
if union_layout
|
||||
.stores_tag_id_in_pointer(env.target_info) =>
|
||||
{
|
||||
tag_pointer_clear_tag_id(env, value.into_pointer_value())
|
||||
let clear_tag_id = match other_layout {
|
||||
LayoutRepr::Union(union_layout) => {
|
||||
union_layout.stores_tag_id_in_pointer(env.target_info)
|
||||
}
|
||||
_ => value.into_pointer_value(),
|
||||
_ => false,
|
||||
};
|
||||
|
||||
let value_ptr = if clear_tag_id {
|
||||
tag_pointer_clear_tag_id(env, value.into_pointer_value())
|
||||
} else {
|
||||
value.into_pointer_value()
|
||||
};
|
||||
|
||||
let then_block = env.context.append_basic_block(parent, "then");
|
||||
|
@ -2944,7 +2947,7 @@ pub(crate) fn build_exp_stmt<'a, 'ctx>(
|
|||
debug_assert!(value.is_pointer_value());
|
||||
let value = value.into_pointer_value();
|
||||
|
||||
let clear_tag_id = match layout_interner.chase_recursive(layout) {
|
||||
let clear_tag_id = match layout_interner.runtime_representation(layout) {
|
||||
LayoutRepr::Union(union) => union.stores_tag_id_in_pointer(env.target_info),
|
||||
_ => false,
|
||||
};
|
||||
|
|
|
@ -1354,7 +1354,7 @@ pub(crate) fn run_low_level<'a, 'ctx>(
|
|||
"cast_to_i8_ptr",
|
||||
);
|
||||
|
||||
let value_ptr = match layout_interner.get_repr(data_layout) {
|
||||
let value_ptr = match layout_interner.runtime_representation(data_layout) {
|
||||
LayoutRepr::Union(union_layout)
|
||||
if union_layout.stores_tag_id_in_pointer(env.target_info) =>
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue