Group toplevel expects by module, run them separately

This commit is contained in:
Jonathan Schear 2024-03-05 21:43:45 -05:00
parent 09b40a1cc3
commit 504e00d44d
No known key found for this signature in database
GPG key ID: 0F4D841667534076
6 changed files with 203 additions and 127 deletions

View file

@ -702,7 +702,7 @@ struct State<'a> {
pub dependencies: Dependencies<'a>,
pub procedures: MutMap<(Symbol, ProcLayout<'a>), Proc<'a>>,
pub host_exposed_lambda_sets: HostExposedLambdaSets<'a>,
pub toplevel_expects: ToplevelExpects,
pub toplevel_expects: MutMap<ModuleId, ToplevelExpects>,
pub exposed_to_host: ExposedToHost,
/// This is the "final" list of IdentIds, after canonicalization and constraint gen
@ -784,7 +784,7 @@ impl<'a> State<'a> {
dependencies,
procedures: MutMap::default(),
host_exposed_lambda_sets: std::vec::Vec::new(),
toplevel_expects: ToplevelExpects::default(),
toplevel_expects: MutMap::default(),
exposed_to_host: ExposedToHost::default(),
exposed_modules: &[],
exposed_types,
@ -2779,8 +2779,9 @@ fn update<'a>(
let subs = solved_subs.into_inner();
state.toplevel_expects.pure.extend(toplevel_expects.pure);
state.toplevel_expects.fx.extend(toplevel_expects.fx);
if toplevel_expects.pure.len() > 0 || toplevel_expects.fx.len() > 0 {
state.toplevel_expects.insert(module_id, toplevel_expects);
}
state
.module_cache