Skip to content

Commit

Permalink
only use main
Browse files Browse the repository at this point in the history
  • Loading branch information
jkelleyrtp committed Feb 14, 2025
1 parent 96b26f4 commit 36cf4b1
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions packages/wasm-split/wasm-split-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,22 +1026,7 @@ impl<'a> Splitter<'a> {
}

// We're going to attach the recovered children to the main function
let main_fn = self
.source_module
.funcs
.iter()
.find(|f| {
let Some(name) = f.name.as_ref() else {
return false;
};

name.starts_with("main")
|| name.contains("lang_start")
|| name.contains("__wbindgen_start")
})
.map(|f| f.id())
.context("Failed to find main function - was this build with LTO, --emit-relocs, and debug symbols?")?;

let main_fn = self.source_module.funcs.by_name("main").context("Failed to find `main` function - was this built with LTO, --emit-relocs, and debug symbols?")?;
let main_fn_entry = new_call_graph.entry(Node::Function(main_fn)).or_default();
main_fn_entry.extend(recovered_children);

Expand Down

0 comments on commit 36cf4b1

Please sign in to comment.