Make entry points optional in code gen

This commit is contained in:
Richard Feldman 2022-08-03 19:47:16 -04:00
parent e685eba42b
commit d260d1e593
No known key found for this signature in database
GPG key ID: 7E4127D1E4241798
4 changed files with 41 additions and 35 deletions

View file

@ -265,20 +265,18 @@ pub fn gen_from_mono_module_llvm(
// expects that would confuse the surgical linker
add_default_roc_externs(&env);
let entry_point = match loaded.entry_point {
let opt_entry_point = match loaded.entry_point {
EntryPoint::Executable { symbol, layout, .. } => {
roc_mono::ir::EntryPoint { symbol, layout }
}
EntryPoint::Test => {
unreachable!()
Some(roc_mono::ir::EntryPoint { symbol, layout })
}
EntryPoint::Test => None,
};
roc_gen_llvm::llvm::build::build_procedures(
&env,
opt_level,
loaded.procedures,
entry_point,
opt_entry_point,
Some(&app_ll_file),
);