Move layout_id from mono to gen

This is because it's actually important that mono never use this.
It should only be used in gen, because it's only safe to use
synchronously, and it's important that mono be done in parallel.

Moving it to gen guarantees that mono will not use it, even accidentally!
This commit is contained in:
Richard Feldman 2020-05-10 11:27:03 -04:00
parent bd6228de8b
commit bf11262e61
7 changed files with 7 additions and 7 deletions

View file

@ -17,7 +17,7 @@ use roc_load::file::{LoadedModule, LoadingProblem};
use roc_module::symbol::Symbol; use roc_module::symbol::Symbol;
use roc_mono::expr::{Env, Expr, PartialProc, Procs}; use roc_mono::expr::{Env, Expr, PartialProc, Procs};
use roc_mono::layout::Layout; use roc_mono::layout::Layout;
use roc_mono::layout_id::LayoutIds; use roc_gen::layout_id::LayoutIds;
use std::time::SystemTime; use std::time::SystemTime;
use clap::{App, Arg, ArgMatches}; use clap::{App, Arg, ArgMatches};

View file

@ -14,13 +14,13 @@ use roc_can::scope::Scope;
use roc_collections::all::{ImMap, ImSet, MutMap, SendMap, SendSet}; use roc_collections::all::{ImMap, ImSet, MutMap, SendMap, SendSet};
use roc_constrain::expr::constrain_expr; use roc_constrain::expr::constrain_expr;
use roc_constrain::module::{constrain_imported_values, load_builtin_aliases, Import}; use roc_constrain::module::{constrain_imported_values, load_builtin_aliases, Import};
use roc_gen::layout_id::LayoutIds;
use roc_gen::llvm::build::{build_proc, build_proc_header, OptLevel}; use roc_gen::llvm::build::{build_proc, build_proc_header, OptLevel};
use roc_gen::llvm::convert::basic_type_from_layout; use roc_gen::llvm::convert::basic_type_from_layout;
use roc_module::ident::Ident; use roc_module::ident::Ident;
use roc_module::symbol::{IdentIds, Interns, ModuleId, ModuleIds, Symbol}; use roc_module::symbol::{IdentIds, Interns, ModuleId, ModuleIds, Symbol};
use roc_mono::expr::Procs; use roc_mono::expr::Procs;
use roc_mono::layout::Layout; use roc_mono::layout::Layout;
use roc_mono::layout_id::LayoutIds;
use roc_parse::ast::{self, Attempting}; use roc_parse::ast::{self, Attempting};
use roc_parse::blankspace::space0_before; use roc_parse::blankspace::space0_before;
use roc_parse::parser::{loc, Fail, FailReason, Parser, State}; use roc_parse::parser::{loc, Fail, FailReason, Parser, State};

View file

@ -1,6 +1,6 @@
use crate::layout::Layout;
use roc_collections::all::{default_hasher, MutMap}; use roc_collections::all::{default_hasher, MutMap};
use roc_module::symbol::{Interns, Symbol}; use roc_module::symbol::{Interns, Symbol};
use roc_mono::layout::Layout;
use std::collections::HashMap; use std::collections::HashMap;
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]

View file

@ -11,4 +11,5 @@
// re-enable this when working on performance optimizations than have it block PRs. // re-enable this when working on performance optimizations than have it block PRs.
#![allow(clippy::large_enum_variant)] #![allow(clippy::large_enum_variant)]
pub mod layout_id;
pub mod llvm; pub mod llvm;

View file

@ -1,3 +1,4 @@
use crate::layout_id::LayoutIds;
use crate::llvm::convert::{ use crate::llvm::convert::{
basic_type_from_layout, collection, get_fn_type, get_ptr_type, ptr_int, basic_type_from_layout, collection, get_fn_type, get_ptr_type, ptr_int,
}; };
@ -17,7 +18,6 @@ use roc_collections::all::ImMap;
use roc_module::symbol::{Interns, Symbol}; use roc_module::symbol::{Interns, Symbol};
use roc_mono::expr::{Expr, Proc}; use roc_mono::expr::{Expr, Proc};
use roc_mono::layout::{Builtin, Layout}; use roc_mono::layout::{Builtin, Layout};
use roc_mono::layout_id::LayoutIds;
use target_lexicon::CallingConvention; use target_lexicon::CallingConvention;
/// This is for Inkwell's FunctionValue::verify - we want to know the verification /// This is for Inkwell's FunctionValue::verify - we want to know the verification

View file

@ -60,7 +60,7 @@ macro_rules! assert_llvm_evals_to {
}; };
let mut procs = Procs::default(); let mut procs = Procs::default();
let mut ident_ids = env.interns.all_ident_ids.remove(&home).unwrap(); let mut ident_ids = env.interns.all_ident_ids.remove(&home).unwrap();
let mut layout_ids = roc_mono::layout_id::LayoutIds::default(); let mut layout_ids = roc_gen::layout_id::LayoutIds::default();
// Populate Procs and get the low-level Expr from the canonical Expr // Populate Procs and get the low-level Expr from the canonical Expr
let mut mono_problems = Vec::new(); let mut mono_problems = Vec::new();
@ -225,7 +225,7 @@ macro_rules! assert_opt_evals_to {
}; };
let mut procs = Procs::default(); let mut procs = Procs::default();
let mut ident_ids = env.interns.all_ident_ids.remove(&home).unwrap(); let mut ident_ids = env.interns.all_ident_ids.remove(&home).unwrap();
let mut layout_ids = roc_mono::layout_id::LayoutIds::default(); let mut layout_ids = roc_gen::layout_id::LayoutIds::default();
// Populate Procs and get the low-level Expr from the canonical Expr // Populate Procs and get the low-level Expr from the canonical Expr
let mut mono_problems = Vec::new(); let mut mono_problems = Vec::new();

View file

@ -13,7 +13,6 @@
pub mod expr; pub mod expr;
pub mod layout; pub mod layout;
pub mod layout_id;
// Temporary, while we can build up test cases and optimize the exhaustiveness checking. // Temporary, while we can build up test cases and optimize the exhaustiveness checking.
// For now, following this warning's advice will lead to nasty type inference errors. // For now, following this warning's advice will lead to nasty type inference errors.