diff --git a/crates/compiler/gen_wasm/src/lib.rs b/crates/compiler/gen_wasm/src/lib.rs index bba0cd4485..c8a0c68989 100644 --- a/crates/compiler/gen_wasm/src/lib.rs +++ b/crates/compiler/gen_wasm/src/lib.rs @@ -70,10 +70,10 @@ pub fn build_app_binary<'a>( host_module: WasmModule<'a>, procedures: MutMap<(Symbol, ProcLayout<'a>), Proc<'a>>, ) -> std::vec::Vec { - 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 { diff --git a/crates/compiler/test_gen/src/wasm_linking.rs b/crates/compiler/test_gen/src/wasm_linking.rs index efe3c20a8c..b331f61881 100644 --- a/crates/compiler/test_gen/src/wasm_linking.rs +++ b/crates/compiler/test_gen/src/wasm_linking.rs @@ -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); diff --git a/crates/repl_wasm/src/repl.rs b/crates/repl_wasm/src/repl.rs index 2d6fa68118..af64165db3 100644 --- a/crates/repl_wasm/src/repl.rs +++ b/crates/repl_wasm/src/repl.rs @@ -244,7 +244,7 @@ pub async fn entrypoint_from_js(src: String) -> Result { .collect::>(), }; - 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 { &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);