Use LayoutCache to avoid recomputing layouts

This commit is contained in:
Richard Feldman 2020-05-09 20:24:55 -04:00
parent efa486251e
commit 510ab36f51
6 changed files with 238 additions and 168 deletions

View file

@ -218,7 +218,7 @@ pub fn gen(src: &str, target: Triple, opt_level: OptLevel) -> Result<(String, St
let expr_type_str = content_to_string(content.clone(), &subs, home, &interns);
// Compute main_fn_type before moving subs to Env
let layout = Layout::from_content(&arena, content, &subs, ptr_bytes).unwrap_or_else(|err| {
let layout = Layout::new(&arena, content, &subs, ptr_bytes).unwrap_or_else(|err| {
panic!(
"Code gen error in test: could not convert to layout. Err was {:?} and Subs were {:?}",
err, subs