Add layout to CallByName

This commit is contained in:
Richard Feldman 2020-05-09 21:21:48 -04:00
parent 510ab36f51
commit c49abfe2de
6 changed files with 156 additions and 111 deletions

View file

@ -451,12 +451,13 @@ fn gen(
env.interns.all_ident_ids.insert(home, ident_ids);
let mut headers = Vec::with_capacity(procs.len());
let (mut proc_map, runtime_errors) = procs.into_map();
// Add all the Proc headers to the module.
// We have to do this in a separate pass first,
// because their bodies may reference each other.
for (symbol, opt_proc) in procs.as_map().into_iter() {
if let Some(proc) = opt_proc {
for (symbol, mut procs_by_layout) in proc_map.drain() {
for (_, proc) in procs_by_layout.drain() {
let (fn_val, arg_basic_types) = build_proc_header(&env, symbol, &proc);
headers.push((proc, fn_val, arg_basic_types));