wasm: Move some of the DCE code from CodeSection to WasmModule

This commit is contained in:
Brian Carroll 2022-06-07 23:52:33 +01:00
parent dfda992d93
commit c00b43c36b
No known key found for this signature in database
GPG key ID: 9CF4E3BF9C4722C7
6 changed files with 98 additions and 116 deletions

View file

@ -151,7 +151,7 @@ fn compile_roc_to_wasm_bytes<'a, T: Wasm32Result>(
index: init_refcount_idx,
});
module.remove_dead_preloads(env.arena, called_preload_fns);
module.eliminate_dead_code(env.arena, called_preload_fns);
let mut app_module_bytes = std::vec::Vec::with_capacity(module.size());
module.serialize(&mut app_module_bytes);