pipe a list of expects to llvm codegen

This commit is contained in:
Folkert 2022-07-10 20:04:08 +02:00
parent 5df489ba23
commit 67cbe6a590
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 17 additions and 17 deletions

View file

@ -628,6 +628,7 @@ pub struct MonomorphizedModule<'a> {
pub can_problems: MutMap<ModuleId, Vec<roc_problem::can::Problem>>,
pub type_problems: MutMap<ModuleId, Vec<solve::TypeError>>,
pub procedures: MutMap<(Symbol, ProcLayout<'a>), Proc<'a>>,
pub toplevel_expects: Vec<Symbol>,
pub entry_point: EntryPoint<'a>,
pub exposed_to_host: ExposedToHost,
pub sources: MutMap<ModuleId, (PathBuf, Box<str>)>,
@ -710,6 +711,7 @@ enum Msg<'a> {
solved_subs: Solved<Subs>,
module_timing: ModuleTiming,
abilities_store: AbilitiesStore,
toplevel_expects: std::vec::Vec<Symbol>,
},
MadeSpecializations {
module_id: ModuleId,
@ -797,6 +799,7 @@ struct State<'a> {
pub module_cache: ModuleCache<'a>,
pub dependencies: Dependencies<'a>,
pub procedures: MutMap<(Symbol, ProcLayout<'a>), Proc<'a>>,
pub toplevel_expects: Vec<Symbol>,
pub exposed_to_host: ExposedToHost,
/// This is the "final" list of IdentIds, after canonicalization and constraint gen
@ -863,6 +866,7 @@ impl<'a> State<'a> {
module_cache: ModuleCache::default(),
dependencies: Dependencies::default(),
procedures: MutMap::default(),
toplevel_expects: Vec::new(),
exposed_to_host: ExposedToHost::default(),
exposed_types,
arc_modules,
@ -2321,11 +2325,14 @@ fn update<'a>(
layout_cache,
module_timing,
abilities_store,
toplevel_expects,
} => {
log!("found specializations for {:?}", module_id);
let subs = solved_subs.into_inner();
state.toplevel_expects.extend(toplevel_expects);
state
.module_cache
.top_level_thunks
@ -2627,6 +2634,7 @@ fn finish_specialization(
};
let State {
toplevel_expects,
procedures,
module_cache,
output_path,
@ -2715,6 +2723,7 @@ fn finish_specialization(
entry_point,
sources,
timings: state.timings,
toplevel_expects,
})
}
@ -4517,13 +4526,14 @@ fn build_pending_specializations<'a>(
mut module_timing: ModuleTiming,
mut layout_cache: LayoutCache<'a>,
target_info: TargetInfo,
exposed_to_host: ExposedToHost, // TODO remove
exposed_to_host: ExposedToHost,
abilities_store: AbilitiesStore,
derived_symbols: GlobalDerivedSymbols,
) -> Msg<'a> {
let find_specializations_start = SystemTime::now();
let mut module_thunks = bumpalo::collections::Vec::new_in(arena);
let mut toplevel_expects = std::vec::Vec::new();
let mut procs_base = ProcsBase {
partial_procs: BumpMap::default(),
@ -4821,6 +4831,7 @@ fn build_pending_specializations<'a>(
is_self_recursive: false,
};
toplevel_expects.push(symbol);
procs_base.partial_procs.insert(symbol, proc);
}
}
@ -4841,6 +4852,7 @@ fn build_pending_specializations<'a>(
procs_base,
module_timing,
abilities_store,
toplevel_expects,
}
}