This commit is contained in:
Folkert 2021-05-13 00:26:41 +02:00
parent d753e64b94
commit e63eea7389
14 changed files with 1455 additions and 1031 deletions

View file

@ -35,7 +35,7 @@ pub fn helper<'a>(
ignore_problems: bool,
context: &'a inkwell::context::Context,
) -> (&'static str, String, Library) {
use roc_gen::llvm::build::{build_proc, build_proc_header, Scope};
use roc_gen::llvm::build::{build_proc, build_proc_header, build_proc_header_new, Scope};
use std::path::{Path, PathBuf};
let filename = PathBuf::from("Test.roc");
@ -239,12 +239,12 @@ pub fn helper<'a>(
// because their bodies may reference each other.
let mut scope = Scope::default();
for ((symbol, layout), proc) in procedures.drain() {
let fn_val = build_proc_header(&env, &mut layout_ids, symbol, &layout, &proc);
let fn_val = build_proc_header_new(&env, &mut layout_ids, symbol, layout, &proc);
if proc.args.is_empty() {
// this is a 0-argument thunk, i.e. a top-level constant definition
// it must be in-scope everywhere in the module!
scope.insert_top_level_thunk(symbol, layout, fn_val);
scope.insert_top_level_thunk_new(symbol, arena.alloc(layout), fn_val);
}
headers.push((proc, fn_val));
@ -275,7 +275,7 @@ pub fn helper<'a>(
mode,
);
// fn_val.print_to_stderr();
fn_val.print_to_stderr();
// module.print_to_stderr();
panic!(
@ -289,7 +289,7 @@ pub fn helper<'a>(
&env,
&mut layout_ids,
main_fn_symbol,
&main_fn_layout,
main_fn_layout,
);
env.dibuilder.finalize();