emit LLVM IR that can be compiled to wasm

This commit is contained in:
Folkert 2021-08-24 20:56:13 +02:00
parent 5a7a9e9520
commit 0a7f7a2772
9 changed files with 33 additions and 25 deletions

View file

@ -93,8 +93,9 @@ pub fn gen_from_mono_module(
}
// Generate the binary
let ptr_bytes = target.pointer_width().unwrap().bytes() as u32;
let context = Context::create();
let module = arena.alloc(module_from_builtins(&context, "app"));
let module = arena.alloc(module_from_builtins(&context, "app", ptr_bytes));
// strip Zig debug stuff
// module.strip_debug_info();
@ -134,7 +135,6 @@ pub fn gen_from_mono_module(
let (mpm, _fpm) = roc_gen_llvm::llvm::build::construct_optimization_passes(module, opt_level);
// Compile and add all the Procs before adding main
let ptr_bytes = target.pointer_width().unwrap().bytes() as u32;
let env = roc_gen_llvm::llvm::build::Env {
arena,
builder: &builder,