remove single entrypoint

This commit is contained in:
Brendan Hansknecht 2024-10-07 16:58:50 -07:00
parent 3c232446d9
commit 5b8b781bad
No known key found for this signature in database
GPG key ID: A199D0660F95F948
4 changed files with 5 additions and 37 deletions

View file

@ -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,

View file

@ -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: &[] },
};

View file

@ -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")),
);

View file

@ -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] },
}