mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
Rename rec_ptr_layout -> recursive_union
I kept thinking it was of type Layout but it's not
This commit is contained in:
parent
ab7867d233
commit
9fb7048de0
1 changed files with 7 additions and 7 deletions
|
@ -51,7 +51,7 @@ struct Specialization<'a> {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct Context<'a> {
|
struct Context<'a> {
|
||||||
new_linker_data: Vec<'a, (Symbol, ProcLayout<'a>)>,
|
new_linker_data: Vec<'a, (Symbol, ProcLayout<'a>)>,
|
||||||
rec_ptr_layout: Option<UnionLayout<'a>>,
|
recursive_union: Option<UnionLayout<'a>>,
|
||||||
op: HelperOp,
|
op: HelperOp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ impl<'a> CodeGenHelp<'a> {
|
||||||
|
|
||||||
let mut ctx = Context {
|
let mut ctx = Context {
|
||||||
new_linker_data: Vec::new_in(self.arena),
|
new_linker_data: Vec::new_in(self.arena),
|
||||||
rec_ptr_layout: None,
|
recursive_union: None,
|
||||||
op: HelperOp::from(modify),
|
op: HelperOp::from(modify),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ impl<'a> CodeGenHelp<'a> {
|
||||||
) -> (Expr<'a>, Vec<'a, (Symbol, ProcLayout<'a>)>) {
|
) -> (Expr<'a>, Vec<'a, (Symbol, ProcLayout<'a>)>) {
|
||||||
let mut ctx = Context {
|
let mut ctx = Context {
|
||||||
new_linker_data: Vec::new_in(self.arena),
|
new_linker_data: Vec::new_in(self.arena),
|
||||||
rec_ptr_layout: None,
|
recursive_union: None,
|
||||||
op: HelperOp::Eq,
|
op: HelperOp::Eq,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ impl<'a> CodeGenHelp<'a> {
|
||||||
self.debug_recursion_depth += 1;
|
self.debug_recursion_depth += 1;
|
||||||
|
|
||||||
let layout = if matches!(called_layout, Layout::RecursivePointer) {
|
let layout = if matches!(called_layout, Layout::RecursivePointer) {
|
||||||
let union_layout = ctx.rec_ptr_layout.unwrap();
|
let union_layout = ctx.recursive_union.unwrap();
|
||||||
Layout::Union(union_layout)
|
Layout::Union(union_layout)
|
||||||
} else {
|
} else {
|
||||||
called_layout
|
called_layout
|
||||||
|
@ -778,9 +778,9 @@ impl<'a> CodeGenHelp<'a> {
|
||||||
) -> Stmt<'a> {
|
) -> Stmt<'a> {
|
||||||
use UnionLayout::*;
|
use UnionLayout::*;
|
||||||
|
|
||||||
let parent_rec_ptr_layout = ctx.rec_ptr_layout;
|
let parent_rec_ptr_layout = ctx.recursive_union;
|
||||||
if !matches!(union_layout, NonRecursive(_)) {
|
if !matches!(union_layout, NonRecursive(_)) {
|
||||||
ctx.rec_ptr_layout = Some(union_layout);
|
ctx.recursive_union = Some(union_layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
let main_stmt = match union_layout {
|
let main_stmt = match union_layout {
|
||||||
|
@ -809,7 +809,7 @@ impl<'a> CodeGenHelp<'a> {
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
ctx.rec_ptr_layout = parent_rec_ptr_layout;
|
ctx.recursive_union = parent_rec_ptr_layout;
|
||||||
|
|
||||||
self.if_pointers_equal_return_true(ident_ids, self.arena.alloc(main_stmt))
|
self.if_pointers_equal_return_true(ident_ids, self.arena.alloc(main_stmt))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue