Merge remote-tracking branch 'origin/trunk' into specialize-lowlevel

This commit is contained in:
Folkert 2021-05-24 15:05:14 +02:00
commit fbb711b2ca
70 changed files with 3513 additions and 126 deletions

View file

@ -52,7 +52,7 @@ const DEFAULT_APP_OUTPUT_PATH: &str = "app";
const ROC_FILE_EXTENSION: &str = "roc";
/// Roc-Config file name
const PKG_CONFIG_FILE_NAME: &str = "Pkg-Config";
const PKG_CONFIG_FILE_NAME: &str = "Package-Config";
/// The . in between module names like Foo.Bar.Baz
const MODULE_SEPARATOR: char = '.';
@ -1894,7 +1894,7 @@ fn update<'a>(
let work = state.dependencies.notify(module_id, Phase::SolveTypes);
// if there is a platform, the Pkg-Config module provides host-exposed,
// if there is a platform, the Package-Config module provides host-exposed,
// otherwise the App module exposes host-exposed
let is_host_exposed = match state.platform_id {
None => module_id == state.root_id,
@ -2060,6 +2060,15 @@ fn update<'a>(
println!("{}", result);
}
if false {
let it = state.procedures.iter().map(|x| x.1);
if let Err(e) = roc_mono::alias_analysis::spec_program(it) {
println!("Error in alias analysis: {:?}", e)
}
}
Proc::insert_refcount_operations(arena, &mut state.procedures);
Proc::optimize_refcount_operations(
@ -2313,7 +2322,7 @@ fn load_pkg_config<'a>(
let chomped = &bytes[..delta];
let header_src = unsafe { std::str::from_utf8_unchecked(chomped) };
// make a Pkg-Config module that ultimately exposes `main` to the host
// make a Package-Config module that ultimately exposes `main` to the host
let pkg_config_module_msg = fabricate_pkg_config_module(
arena,
shorthand,
@ -2552,7 +2561,7 @@ fn parse_header<'a>(
}) => {
match package_or_path {
PackageOrPath::Path(StrLiteral::PlainLine(package)) => {
// check whether we can find a Pkg-Config.roc file
// check whether we can find a Package-Config.roc file
let mut pkg_config_roc = pkg_config_dir;
pkg_config_roc.push(package);
pkg_config_roc.push(PKG_CONFIG_FILE_NAME);
@ -3800,6 +3809,8 @@ fn make_specializations<'a>(
home,
ident_ids: &mut ident_ids,
ptr_bytes,
update_mode_counter: 0,
call_specialization_counter: 0,
};
// TODO: for now this final specialization pass is sequential,
@ -3861,6 +3872,8 @@ fn build_pending_specializations<'a>(
home,
ident_ids: &mut ident_ids,
ptr_bytes,
update_mode_counter: 0,
call_specialization_counter: 0,
};
// Add modules' decls to Procs