Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify API for parsing the name section #805

Merged
merged 3 commits into from Oct 27, 2022

Conversation

alexcrichton
Copy link
Member

This commit modernizes the API to parse the name section in wasmparser, notably leveraging existing traits and removing some indirection through extra structures. The intent is to enable iterator-based parsing similar to the rest of parsing items in this crate, meaning the same idioms can be used for the name section as all other sections.

At the same time this commit also adds a new subcommand I thought of recently as wasm-tools demangle which runs a Rust or C++ demangler over the name section. This is almost guaranteed to increase the size of the name section but it otherwise might be useful when interacting with tools that don't otherwise demangle names automatically, for example web or JS runtimes.

This commit modernizes the API to parse the `name` section in
`wasmparser`, notably leveraging existing traits and removing some
indirection through extra structures. The intent is to enable
iterator-based parsing similar to the rest of parsing items in this
crate, meaning the same idioms can be used for the `name` section as all
other sections.

At the same time this commit also adds a new subcommand I thought of
recently as `wasm-tools demangle` which runs a Rust or C++ demangler
over the `name` section. This is almost guaranteed to increase the size
of the `name` section but it otherwise might be useful when interacting
with tools that don't otherwise demangle names automatically, for
example web or JS runtimes.
@alexcrichton alexcrichton merged commit 3094923 into bytecodealliance:main Oct 27, 2022
@alexcrichton alexcrichton deleted the wasm-tools-demangle branch October 27, 2022 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants