mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
refactor entry point
This commit is contained in:
parent
866b5177cd
commit
a72556b927
7 changed files with 72 additions and 62 deletions
|
@ -3,7 +3,7 @@ use roc_error_macros::internal_error;
|
|||
use roc_gen_llvm::llvm::build::{module_from_builtins, LlvmBackendMode};
|
||||
use roc_gen_llvm::llvm::externs::add_default_roc_externs;
|
||||
use roc_load::{EntryPoint, ExpectMetadata, LoadedModule, MonomorphizedModule};
|
||||
use roc_mono::ir::OptLevel;
|
||||
use roc_mono::ir::{OptLevel, SingleEntryPoint};
|
||||
use roc_reporting::cli::{report_problems, Problems};
|
||||
use std::ops::Deref;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
@ -188,18 +188,18 @@ fn gen_from_mono_module_llvm<'a>(
|
|||
// expects that would confuse the surgical linker
|
||||
add_default_roc_externs(&env);
|
||||
|
||||
let opt_entry_point = match loaded.entry_point {
|
||||
let entry_point = match loaded.entry_point {
|
||||
EntryPoint::Executable { symbol, layout, .. } => {
|
||||
Some(roc_mono::ir::EntryPoint { symbol, layout })
|
||||
roc_mono::ir::EntryPoint::Single(SingleEntryPoint { symbol, layout })
|
||||
}
|
||||
EntryPoint::Test => None,
|
||||
EntryPoint::Test => roc_mono::ir::EntryPoint::Expects { symbols: &[] },
|
||||
};
|
||||
|
||||
roc_gen_llvm::llvm::build::build_procedures(
|
||||
&env,
|
||||
opt_level,
|
||||
loaded.procedures,
|
||||
opt_entry_point,
|
||||
entry_point,
|
||||
Some(&app_ll_file),
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue