mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Pass abilities store to mono
This commit is contained in:
parent
6472e32173
commit
eb81c68bcb
3 changed files with 31 additions and 1 deletions
|
@ -271,6 +271,7 @@ fn start_phase<'a>(
|
|||
solved_subs,
|
||||
decls,
|
||||
ident_ids,
|
||||
abilities_store,
|
||||
} = typechecked;
|
||||
|
||||
let mut imported_module_thunks = bumpalo::collections::Vec::new_in(arena);
|
||||
|
@ -294,6 +295,7 @@ fn start_phase<'a>(
|
|||
decls,
|
||||
ident_ids,
|
||||
exposed_to_host: state.exposed_to_host.clone(),
|
||||
abilities_store,
|
||||
}
|
||||
}
|
||||
Phase::MakeSpecializations => {
|
||||
|
@ -316,6 +318,7 @@ fn start_phase<'a>(
|
|||
procs_base,
|
||||
layout_cache,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
} = found_specializations;
|
||||
|
||||
BuildTask::MakeSpecializations {
|
||||
|
@ -326,6 +329,7 @@ fn start_phase<'a>(
|
|||
layout_cache,
|
||||
specializations_we_must_make,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -419,6 +423,7 @@ pub struct TypeCheckedModule<'a> {
|
|||
pub solved_subs: Solved<Subs>,
|
||||
pub decls: Vec<Declaration>,
|
||||
pub ident_ids: IdentIds,
|
||||
pub abilities_store: AbilitiesStore,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -429,6 +434,7 @@ struct FoundSpecializationsModule<'a> {
|
|||
procs_base: ProcsBase<'a>,
|
||||
subs: Subs,
|
||||
module_timing: ModuleTiming,
|
||||
abilities_store: AbilitiesStore,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -529,6 +535,7 @@ enum Msg<'a> {
|
|||
problems: Vec<roc_mono::ir::MonoProblem>,
|
||||
solved_subs: Solved<Subs>,
|
||||
module_timing: ModuleTiming,
|
||||
abilities_store: AbilitiesStore,
|
||||
},
|
||||
MadeSpecializations {
|
||||
module_id: ModuleId,
|
||||
|
@ -767,6 +774,7 @@ enum BuildTask<'a> {
|
|||
ident_ids: IdentIds,
|
||||
decls: Vec<Declaration>,
|
||||
exposed_to_host: ExposedToHost,
|
||||
abilities_store: AbilitiesStore,
|
||||
},
|
||||
MakeSpecializations {
|
||||
module_id: ModuleId,
|
||||
|
@ -776,6 +784,7 @@ enum BuildTask<'a> {
|
|||
layout_cache: LayoutCache<'a>,
|
||||
specializations_we_must_make: Vec<ExternalSpecializations>,
|
||||
module_timing: ModuleTiming,
|
||||
abilities_store: AbilitiesStore,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -1880,6 +1889,7 @@ fn update<'a>(
|
|||
solved_subs,
|
||||
decls,
|
||||
ident_ids,
|
||||
abilities_store,
|
||||
};
|
||||
|
||||
state
|
||||
|
@ -1904,6 +1914,7 @@ fn update<'a>(
|
|||
layout_cache,
|
||||
problems,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
} => {
|
||||
log!("found specializations for {:?}", module_id);
|
||||
|
||||
|
@ -1925,6 +1936,7 @@ fn update<'a>(
|
|||
procs_base,
|
||||
subs,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
};
|
||||
|
||||
state
|
||||
|
@ -3642,6 +3654,7 @@ fn make_specializations<'a>(
|
|||
specializations_we_must_make: Vec<ExternalSpecializations>,
|
||||
mut module_timing: ModuleTiming,
|
||||
target_info: TargetInfo,
|
||||
abilities_store: AbilitiesStore,
|
||||
) -> Msg<'a> {
|
||||
let make_specializations_start = SystemTime::now();
|
||||
let mut mono_problems = Vec::new();
|
||||
|
@ -3657,6 +3670,7 @@ fn make_specializations<'a>(
|
|||
update_mode_ids: &mut update_mode_ids,
|
||||
// call_specialization_counter=0 is reserved
|
||||
call_specialization_counter: 1,
|
||||
abilities_store: &abilities_store,
|
||||
};
|
||||
|
||||
let mut procs = Procs::new_in(arena);
|
||||
|
@ -3727,6 +3741,7 @@ fn build_pending_specializations<'a>(
|
|||
target_info: TargetInfo,
|
||||
// TODO remove
|
||||
exposed_to_host: ExposedToHost,
|
||||
abilities_store: AbilitiesStore,
|
||||
) -> Msg<'a> {
|
||||
let find_specializations_start = SystemTime::now();
|
||||
|
||||
|
@ -3753,6 +3768,7 @@ fn build_pending_specializations<'a>(
|
|||
update_mode_ids: &mut update_mode_ids,
|
||||
// call_specialization_counter=0 is reserved
|
||||
call_specialization_counter: 1,
|
||||
abilities_store: &abilities_store,
|
||||
};
|
||||
|
||||
// Add modules' decls to Procs
|
||||
|
@ -3806,6 +3822,7 @@ fn build_pending_specializations<'a>(
|
|||
procs_base,
|
||||
problems,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3823,7 +3840,11 @@ fn add_def_to_module<'a>(
|
|||
use roc_can::pattern::Pattern::*;
|
||||
|
||||
match def.loc_pattern.value {
|
||||
Identifier(symbol) => {
|
||||
Identifier(symbol)
|
||||
| AbilityMemberSpecialization {
|
||||
ident: symbol,
|
||||
specializes: _,
|
||||
} => {
|
||||
let is_host_exposed = exposed_to_host.contains_key(&symbol);
|
||||
|
||||
match def.loc_expr.value {
|
||||
|
@ -4026,6 +4047,7 @@ fn run_task<'a>(
|
|||
solved_subs,
|
||||
imported_module_thunks,
|
||||
exposed_to_host,
|
||||
abilities_store,
|
||||
} => Ok(build_pending_specializations(
|
||||
arena,
|
||||
solved_subs,
|
||||
|
@ -4037,6 +4059,7 @@ fn run_task<'a>(
|
|||
layout_cache,
|
||||
target_info,
|
||||
exposed_to_host,
|
||||
abilities_store,
|
||||
)),
|
||||
MakeSpecializations {
|
||||
module_id,
|
||||
|
@ -4046,6 +4069,7 @@ fn run_task<'a>(
|
|||
layout_cache,
|
||||
specializations_we_must_make,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
} => Ok(make_specializations(
|
||||
arena,
|
||||
module_id,
|
||||
|
@ -4056,6 +4080,7 @@ fn run_task<'a>(
|
|||
specializations_we_must_make,
|
||||
module_timing,
|
||||
target_info,
|
||||
abilities_store,
|
||||
)),
|
||||
}?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue