mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Merge branch 'vecset-references' into builtins-in-roc
This commit is contained in:
commit
8692938fb3
18 changed files with 537 additions and 142 deletions
|
@ -338,6 +338,7 @@ fn start_phase<'a>(
|
|||
solved_subs,
|
||||
decls,
|
||||
ident_ids,
|
||||
abilities_store,
|
||||
} = typechecked;
|
||||
|
||||
let mut imported_module_thunks = bumpalo::collections::Vec::new_in(arena);
|
||||
|
@ -361,6 +362,7 @@ fn start_phase<'a>(
|
|||
decls,
|
||||
ident_ids,
|
||||
exposed_to_host: state.exposed_to_host.clone(),
|
||||
abilities_store,
|
||||
}
|
||||
}
|
||||
Phase::MakeSpecializations => {
|
||||
|
@ -383,6 +385,7 @@ fn start_phase<'a>(
|
|||
procs_base,
|
||||
layout_cache,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
} = found_specializations;
|
||||
|
||||
BuildTask::MakeSpecializations {
|
||||
|
@ -393,6 +396,7 @@ fn start_phase<'a>(
|
|||
layout_cache,
|
||||
specializations_we_must_make,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -486,6 +490,7 @@ pub struct TypeCheckedModule<'a> {
|
|||
pub solved_subs: Solved<Subs>,
|
||||
pub decls: Vec<Declaration>,
|
||||
pub ident_ids: IdentIds,
|
||||
pub abilities_store: AbilitiesStore,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -496,6 +501,7 @@ struct FoundSpecializationsModule<'a> {
|
|||
procs_base: ProcsBase<'a>,
|
||||
subs: Subs,
|
||||
module_timing: ModuleTiming,
|
||||
abilities_store: AbilitiesStore,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
@ -596,6 +602,7 @@ enum Msg<'a> {
|
|||
problems: Vec<roc_mono::ir::MonoProblem>,
|
||||
solved_subs: Solved<Subs>,
|
||||
module_timing: ModuleTiming,
|
||||
abilities_store: AbilitiesStore,
|
||||
},
|
||||
MadeSpecializations {
|
||||
module_id: ModuleId,
|
||||
|
@ -837,6 +844,7 @@ enum BuildTask<'a> {
|
|||
ident_ids: IdentIds,
|
||||
decls: Vec<Declaration>,
|
||||
exposed_to_host: ExposedToHost,
|
||||
abilities_store: AbilitiesStore,
|
||||
},
|
||||
MakeSpecializations {
|
||||
module_id: ModuleId,
|
||||
|
@ -846,6 +854,7 @@ enum BuildTask<'a> {
|
|||
layout_cache: LayoutCache<'a>,
|
||||
specializations_we_must_make: Vec<ExternalSpecializations>,
|
||||
module_timing: ModuleTiming,
|
||||
abilities_store: AbilitiesStore,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -2071,6 +2080,7 @@ fn update<'a>(
|
|||
solved_subs,
|
||||
decls,
|
||||
ident_ids,
|
||||
abilities_store,
|
||||
};
|
||||
|
||||
state
|
||||
|
@ -2095,6 +2105,7 @@ fn update<'a>(
|
|||
layout_cache,
|
||||
problems,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
} => {
|
||||
log!("found specializations for {:?}", module_id);
|
||||
|
||||
|
@ -2116,6 +2127,7 @@ fn update<'a>(
|
|||
procs_base,
|
||||
subs,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
};
|
||||
|
||||
state
|
||||
|
@ -4028,6 +4040,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();
|
||||
|
@ -4043,6 +4056,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);
|
||||
|
@ -4113,6 +4127,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();
|
||||
|
||||
|
@ -4139,6 +4154,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
|
||||
|
@ -4192,6 +4208,7 @@ fn build_pending_specializations<'a>(
|
|||
procs_base,
|
||||
problems,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4209,7 +4226,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 {
|
||||
|
@ -4419,6 +4440,7 @@ fn run_task<'a>(
|
|||
solved_subs,
|
||||
imported_module_thunks,
|
||||
exposed_to_host,
|
||||
abilities_store,
|
||||
} => Ok(build_pending_specializations(
|
||||
arena,
|
||||
solved_subs,
|
||||
|
@ -4430,6 +4452,7 @@ fn run_task<'a>(
|
|||
layout_cache,
|
||||
target_info,
|
||||
exposed_to_host,
|
||||
abilities_store,
|
||||
)),
|
||||
MakeSpecializations {
|
||||
module_id,
|
||||
|
@ -4439,6 +4462,7 @@ fn run_task<'a>(
|
|||
layout_cache,
|
||||
specializations_we_must_make,
|
||||
module_timing,
|
||||
abilities_store,
|
||||
} => Ok(make_specializations(
|
||||
arena,
|
||||
module_id,
|
||||
|
@ -4449,6 +4473,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