Inline interners into the layout interner module

I realized that we'll need to make the layout interner more complicated
to support things like recursive pointers pointing to their parents and
to support lambda set layout caching. Since the layout interner is the
only user of intern crate right now anyway, just inline the whole thing.
This commit is contained in:
Ayaz Hafiz 2023-01-03 14:19:39 -06:00
parent 82e6982196
commit 50826d1a83
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
32 changed files with 277 additions and 376 deletions

View file

@ -5,7 +5,6 @@ use bumpalo::Bump;
use roc_builtins::bitcode::{FloatWidth, IntWidth};
use roc_collections::all::{default_hasher, FnvMap, MutMap};
use roc_error_macros::{internal_error, todo_abilities};
use roc_intern::Interner;
use roc_module::ident::{Lowercase, TagName};
use roc_module::symbol::{Interns, Symbol};
use roc_problem::can::RuntimeError;
@ -23,7 +22,9 @@ use std::hash::{Hash, Hasher};
use ven_pretty::{DocAllocator, DocBuilder};
mod intern;
pub use intern::{GlobalLayoutInterner, LayoutInterner, STLayoutInterner, TLLayoutInterner};
pub use intern::{
GlobalLayoutInterner, InLayout, LayoutInterner, STLayoutInterner, TLLayoutInterner,
};
// if your changes cause this number to go down, great!
// please change it to the lower number.
@ -661,10 +662,6 @@ impl FieldOrderHash {
}
}
/// An interned layout.
// One day I would like to take over `LayoutId` as the name here, but that is currently used elsewhere.
pub type InLayout<'a> = roc_intern::Interned<Layout<'a>>;
/// Types for code gen must be monomorphic. No type variables allowed!
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum Layout<'a> {