Wrap layouts in a LayoutRepr constructor

Part 1 of support semantic layout representations.
This commit is contained in:
Ayaz Hafiz 2023-05-10 13:22:10 -05:00
parent c2d2bd4bb9
commit c3eeb5e2cc
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
32 changed files with 1254 additions and 1021 deletions

View file

@ -10,7 +10,7 @@ use crate::ir::{
BranchInfo, Expr, JoinPointId, ModifyRc, Param, Proc, ProcLayout, Stmt, UpdateModeId,
UpdateModeIds,
};
use crate::layout::{InLayout, Layout, LayoutInterner, STLayoutInterner, UnionLayout};
use crate::layout::{InLayout, LayoutInterner, LayoutRepr, STLayoutInterner, UnionLayout};
use bumpalo::Bump;
@ -1133,8 +1133,8 @@ fn symbol_layout_reusability<'a>(
symbol: &Symbol,
layout: &InLayout<'a>,
) -> Reuse {
match layout_interner.get(*layout) {
Layout::Union(union_layout) => {
match layout_interner.get(*layout).repr {
LayoutRepr::Union(union_layout) => {
can_reuse_union_layout_tag(&union_layout, environment.get_symbol_tag(symbol))
}
// Strings literals are constants.