rename called_preload_fns to called_fns

This commit is contained in:
Brian Carroll 2022-11-21 19:48:02 +00:00
parent c16d425936
commit a3cfdd478d
No known key found for this signature in database
GPG Key ID: 9CF4E3BF9C4722C7
3 changed files with 9 additions and 9 deletions

View File

@ -70,10 +70,10 @@ pub fn build_app_binary<'a>(
host_module: WasmModule<'a>,
procedures: MutMap<(Symbol, ProcLayout<'a>), Proc<'a>>,
) -> std::vec::Vec<u8> {
let (mut wasm_module, called_preload_fns, _) =
let (mut wasm_module, called_fns, _) =
build_app_module(env, interns, host_module, procedures);
wasm_module.eliminate_dead_code(env.arena, called_preload_fns);
wasm_module.eliminate_dead_code(env.arena, called_fns);
let mut buffer = std::vec::Vec::with_capacity(wasm_module.size());
wasm_module.serialize(&mut buffer);
@ -185,11 +185,11 @@ pub fn build_app_module<'a>(
}
}
let (module, called_preload_fns) = backend.finalize();
let (module, called_fns) = backend.finalize();
let main_function_index =
maybe_main_fn_index.expect("The app must expose at least one value to the host");
(module, called_preload_fns, main_function_index)
(module, called_fns, main_function_index)
}
pub struct CopyMemoryConfig {

View File

@ -252,7 +252,7 @@ fn test_linking_without_dce() {
]
);
let (final_module, _called_preload_fns, _roc_main_index) =
let (final_module, _called_fns, _roc_main_index) =
roc_gen_wasm::build_app_module(&env, &mut interns, host_module, procedures);
let mut buffer = Vec::with_capacity(final_module.size());
@ -309,10 +309,10 @@ fn test_linking_with_dce() {
assert!(&host_module.names.function_names.is_empty());
let (mut final_module, called_preload_fns, _roc_main_index) =
let (mut final_module, called_fns, _roc_main_index) =
roc_gen_wasm::build_app_module(&env, &mut interns, host_module, procedures);
final_module.eliminate_dead_code(env.arena, called_preload_fns);
final_module.eliminate_dead_code(env.arena, called_fns);
let mut buffer = Vec::with_capacity(final_module.size());
final_module.serialize(&mut buffer);

View File

@ -244,7 +244,7 @@ pub async fn entrypoint_from_js(src: String) -> Result<String, String> {
.collect::<MutSet<_>>(),
};
let (mut module, called_preload_fns, main_fn_index) = {
let (mut module, mut called_fns, main_fn_index) = {
let host_module = roc_gen_wasm::parse_host(env.arena, PRE_LINKED_BINARY).unwrap();
roc_gen_wasm::build_app_module(
&env,
@ -263,7 +263,7 @@ pub async fn entrypoint_from_js(src: String) -> Result<String, String> {
&main_fn_layout.result,
);
module.eliminate_dead_code(env.arena, called_preload_fns);
module.eliminate_dead_code(env.arena, called_fns);
let mut buffer = Vec::with_capacity_in(module.size(), arena);
module.serialize(&mut buffer);