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

@ -358,7 +358,7 @@ fn gen(
// Compute main_fn_type before moving subs to Env
let ptr_bytes = target.pointer_width().unwrap().bytes() as u32;
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