mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-22 05:55:00 +00:00
remove single entrypoint
This commit is contained in:
parent
3c232446d9
commit
5b8b781bad
4 changed files with 5 additions and 37 deletions
|
@ -238,38 +238,7 @@ where
|
|||
}
|
||||
|
||||
match entry_point {
|
||||
EntryPoint::Single(SingleEntryPoint {
|
||||
name: entry_point_name,
|
||||
symbol: entry_point_symbol,
|
||||
layout: entry_point_layout,
|
||||
}) => {
|
||||
// the entry point wrapper
|
||||
let roc_main_bytes = func_name_bytes_help(
|
||||
entry_point_symbol,
|
||||
entry_point_layout.arguments.iter().copied(),
|
||||
Niche::NONE,
|
||||
entry_point_layout.result,
|
||||
);
|
||||
let roc_main = FuncName(&roc_main_bytes);
|
||||
|
||||
let mut env = Env::new();
|
||||
|
||||
let entry_point_function = build_entry_point(
|
||||
&mut env,
|
||||
interner,
|
||||
entry_point_layout,
|
||||
Some(roc_main),
|
||||
&host_exposed_functions,
|
||||
&erased_functions,
|
||||
)?;
|
||||
|
||||
type_definitions.extend(env.type_names);
|
||||
|
||||
entry_point_names.push(entry_point_name.as_bytes());
|
||||
let entry_point_name = FuncName(entry_point_name.as_bytes());
|
||||
m.add_func(entry_point_name, entry_point_function)?;
|
||||
}
|
||||
EntryPoint::Multiple(entry_points) => {
|
||||
EntryPoint::Program(entry_points) => {
|
||||
for SingleEntryPoint {
|
||||
name: entry_point_name,
|
||||
symbol: entry_point_symbol,
|
||||
|
|
|
@ -237,7 +237,7 @@ fn gen_from_mono_module_llvm<'a>(
|
|||
})
|
||||
.collect_in(arena);
|
||||
|
||||
roc_mono::ir::EntryPoint::Multiple(entry_points.into_bump_slice())
|
||||
roc_mono::ir::EntryPoint::Program(entry_points.into_bump_slice())
|
||||
}
|
||||
EntryPoint::Test => roc_mono::ir::EntryPoint::Expects { symbols: &[] },
|
||||
};
|
||||
|
|
|
@ -5592,7 +5592,7 @@ pub fn build_wasm_test_wrapper<'a, 'ctx>(
|
|||
opt_level,
|
||||
procedures,
|
||||
vec![],
|
||||
EntryPoint::Single(entry_point),
|
||||
EntryPoint::Program(env.arena.alloc([entry_point])),
|
||||
Some(&std::env::temp_dir().join("test.ll")),
|
||||
);
|
||||
|
||||
|
@ -5619,7 +5619,7 @@ pub fn build_procedures_return_main<'a, 'ctx>(
|
|||
opt_level,
|
||||
procedures,
|
||||
host_exposed_lambda_sets,
|
||||
EntryPoint::Single(entry_point),
|
||||
EntryPoint::Program(env.arena.alloc([entry_point])),
|
||||
Some(&std::env::temp_dir().join("test.ll")),
|
||||
);
|
||||
|
||||
|
|
|
@ -139,8 +139,7 @@ pub struct SingleEntryPoint<'a> {
|
|||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum EntryPoint<'a> {
|
||||
Single(SingleEntryPoint<'a>),
|
||||
Multiple(&'a [SingleEntryPoint<'a>]),
|
||||
Program(&'a [SingleEntryPoint<'a>]),
|
||||
Expects { symbols: &'a [Symbol] },
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue