mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Merge remote-tracking branch 'origin/trunk' into refcount
This commit is contained in:
commit
4caef70668
8 changed files with 1981 additions and 14 deletions
|
@ -259,7 +259,6 @@ pub fn gen(src: &[u8], target: Triple, opt_level: OptLevel) -> Result<(String, S
|
||||||
problems: &mut mono_problems,
|
problems: &mut mono_problems,
|
||||||
home,
|
home,
|
||||||
ident_ids: &mut ident_ids,
|
ident_ids: &mut ident_ids,
|
||||||
jump_counter: arena.alloc(0),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let main_body = roc_mono::ir::Stmt::new(&mut mono_env, loc_expr.value, &mut procs);
|
let main_body = roc_mono::ir::Stmt::new(&mut mono_env, loc_expr.value, &mut procs);
|
||||||
|
|
|
@ -169,7 +169,6 @@ pub fn gen(
|
||||||
problems: &mut mono_problems,
|
problems: &mut mono_problems,
|
||||||
home,
|
home,
|
||||||
ident_ids: &mut ident_ids,
|
ident_ids: &mut ident_ids,
|
||||||
jump_counter: arena.alloc(0),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add modules' decls to Procs
|
// Add modules' decls to Procs
|
||||||
|
|
|
@ -103,7 +103,6 @@ pub fn helper_without_uniqueness<'a>(
|
||||||
problems: &mut mono_problems,
|
problems: &mut mono_problems,
|
||||||
home,
|
home,
|
||||||
ident_ids: &mut ident_ids,
|
ident_ids: &mut ident_ids,
|
||||||
jump_counter: arena.alloc(0),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let main_body = roc_mono::ir::Stmt::new(&mut mono_env, loc_expr.value, &mut procs);
|
let main_body = roc_mono::ir::Stmt::new(&mut mono_env, loc_expr.value, &mut procs);
|
||||||
|
@ -295,7 +294,6 @@ pub fn helper_with_uniqueness<'a>(
|
||||||
problems: &mut mono_problems,
|
problems: &mut mono_problems,
|
||||||
home,
|
home,
|
||||||
ident_ids: &mut ident_ids,
|
ident_ids: &mut ident_ids,
|
||||||
jump_counter: arena.alloc(0),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let main_body = roc_mono::ir::Stmt::new(&mut mono_env, loc_expr.value, &mut procs);
|
let main_body = roc_mono::ir::Stmt::new(&mut mono_env, loc_expr.value, &mut procs);
|
||||||
|
|
|
@ -910,7 +910,7 @@ pub fn optimize_when<'a>(
|
||||||
|
|
||||||
let choice_decider = insert_choices(&choices, decider);
|
let choice_decider = insert_choices(&choices, decider);
|
||||||
|
|
||||||
let expr = decide_to_branching(
|
decide_to_branching(
|
||||||
env,
|
env,
|
||||||
procs,
|
procs,
|
||||||
layout_cache,
|
layout_cache,
|
||||||
|
@ -919,12 +919,7 @@ pub fn optimize_when<'a>(
|
||||||
ret_layout,
|
ret_layout,
|
||||||
choice_decider,
|
choice_decider,
|
||||||
&jumps,
|
&jumps,
|
||||||
);
|
)
|
||||||
|
|
||||||
// increase the jump counter by the number of jumps in this branching structure
|
|
||||||
*env.jump_counter += jumps.len() as u64;
|
|
||||||
|
|
||||||
expr
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn path_to_expr<'a>(
|
fn path_to_expr<'a>(
|
||||||
|
|
1979
compiler/mono/src/expr.rs
Normal file
1979
compiler/mono/src/expr.rs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -306,7 +306,6 @@ pub struct Env<'a, 'i> {
|
||||||
pub problems: &'i mut std::vec::Vec<MonoProblem>,
|
pub problems: &'i mut std::vec::Vec<MonoProblem>,
|
||||||
pub home: ModuleId,
|
pub home: ModuleId,
|
||||||
pub ident_ids: &'i mut IdentIds,
|
pub ident_ids: &'i mut IdentIds,
|
||||||
pub jump_counter: &'a mut u64,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'i> Env<'a, 'i> {
|
impl<'a, 'i> Env<'a, 'i> {
|
||||||
|
|
|
@ -58,7 +58,6 @@ mod test_mono {
|
||||||
problems: &mut mono_problems,
|
problems: &mut mono_problems,
|
||||||
home,
|
home,
|
||||||
ident_ids: &mut ident_ids,
|
ident_ids: &mut ident_ids,
|
||||||
jump_counter: arena.alloc(0),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut layout_cache = LayoutCache::default();
|
let mut layout_cache = LayoutCache::default();
|
||||||
|
|
|
@ -93,7 +93,6 @@ mod test_reporting {
|
||||||
problems: &mut mono_problems,
|
problems: &mut mono_problems,
|
||||||
home,
|
home,
|
||||||
ident_ids: &mut ident_ids,
|
ident_ids: &mut ident_ids,
|
||||||
jump_counter: arena.alloc(0),
|
|
||||||
};
|
};
|
||||||
let _mono_expr = Stmt::new(&mut mono_env, loc_expr.value, &mut procs);
|
let _mono_expr = Stmt::new(&mut mono_env, loc_expr.value, &mut procs);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue