minor tweaks

This commit is contained in:
Brian Carroll 2022-11-16 21:25:16 +00:00
parent 24cef94fb5
commit ba99870de0
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
2 changed files with 3 additions and 4 deletions

View file

@ -242,7 +242,6 @@ pub struct WasmDebugSettings {
instructions: bool, instructions: bool,
storage_map: bool, storage_map: bool,
pub keep_test_binary: bool, pub keep_test_binary: bool,
pub skip_dead_code_elim: bool,
} }
pub const DEBUG_SETTINGS: WasmDebugSettings = WasmDebugSettings { pub const DEBUG_SETTINGS: WasmDebugSettings = WasmDebugSettings {
@ -253,7 +252,6 @@ pub const DEBUG_SETTINGS: WasmDebugSettings = WasmDebugSettings {
instructions: false && cfg!(debug_assertions), instructions: false && cfg!(debug_assertions),
storage_map: false && cfg!(debug_assertions), storage_map: false && cfg!(debug_assertions),
keep_test_binary: false && cfg!(debug_assertions), keep_test_binary: false && cfg!(debug_assertions),
skip_dead_code_elim: false && cfg!(debug_assertions),
}; };
#[cfg(test)] #[cfg(test)]

View file

@ -138,10 +138,11 @@ fn compile_roc_to_wasm_bytes<'a, T: Wasm32Result>(
) )
}); });
let (mut module, called_preload_fns, main_fn_index) = let (mut module, mut called_fns, main_fn_index) =
roc_gen_wasm::build_app_module(&env, &mut interns, host_module, procedures); roc_gen_wasm::build_app_module(&env, &mut interns, host_module, procedures);
T::insert_wrapper(arena, &mut module, TEST_WRAPPER_NAME, main_fn_index); T::insert_wrapper(arena, &mut module, TEST_WRAPPER_NAME, main_fn_index);
called_fns.push(true);
// Export the initialiser function for refcount tests // Export the initialiser function for refcount tests
let init_refcount_idx = module let init_refcount_idx = module
@ -158,7 +159,7 @@ fn compile_roc_to_wasm_bytes<'a, T: Wasm32Result>(
index: init_refcount_idx, index: init_refcount_idx,
}); });
module.eliminate_dead_code(env.arena, called_preload_fns); module.eliminate_dead_code(env.arena, called_fns);
let mut app_module_bytes = std::vec::Vec::with_capacity(module.size()); let mut app_module_bytes = std::vec::Vec::with_capacity(module.size());
module.serialize(&mut app_module_bytes); module.serialize(&mut app_module_bytes);