mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Fix lifetime errors due to interner
In the llvm backend, there are the lifetimes `'a` (lifetime of the global arena) and `'ctx` (lifetime of constructed LLVM values). `'a` lives longer than `'ctx`, but the compiler didn't enforce this until the layout interner was introduced, for some reason. We have to make sure that containers of lifetime `'a` have no `'ctx` references.
This commit is contained in:
parent
512a1721ae
commit
759f8d86af
6 changed files with 54 additions and 55 deletions
|
@ -100,7 +100,7 @@ fn create_llvm_module<'a>(
|
|||
let MonomorphizedModule {
|
||||
procedures,
|
||||
interns,
|
||||
layout_interner,
|
||||
mut layout_interner,
|
||||
..
|
||||
} = loaded;
|
||||
|
||||
|
@ -217,7 +217,6 @@ fn create_llvm_module<'a>(
|
|||
// Compile and add all the Procs before adding main
|
||||
let env = roc_gen_llvm::llvm::build::Env {
|
||||
arena,
|
||||
layout_interner: &layout_interner,
|
||||
builder: &builder,
|
||||
dibuilder: &dibuilder,
|
||||
compile_unit: &compile_unit,
|
||||
|
@ -258,12 +257,14 @@ fn create_llvm_module<'a>(
|
|||
LlvmBackendMode::CliTest => unreachable!(),
|
||||
LlvmBackendMode::WasmGenTest => roc_gen_llvm::llvm::build::build_wasm_test_wrapper(
|
||||
&env,
|
||||
&mut layout_interner,
|
||||
config.opt_level,
|
||||
procedures,
|
||||
entry_point,
|
||||
),
|
||||
LlvmBackendMode::GenTest => roc_gen_llvm::llvm::build::build_procedures_return_main(
|
||||
&env,
|
||||
&mut layout_interner,
|
||||
config.opt_level,
|
||||
procedures,
|
||||
entry_point,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue