Skip to content

wasm2c: Always use a module prefix and set one by default - #1897

Merged
sbc100 merged 1 commit into
mainfrom
default_wasm2c_prefix
Apr 14, 2022
Merged

sbc100 merged 1 commit into
mainfrom
default_wasm2c_prefix

Conversation

@sbc100

@sbc100 sbc100 commented Apr 13, 2022

Copy link
Copy Markdown
Member

The module prefix is no longer optional and is now set by default to the
name of the module as given in the name section, or taken from the name
of the input file.

A new -n/--module-name command line flag can also be used to override.

The prefix used by the generated code is now fixed at wasm2c time which
makes the output code easier to read and also avoid the symbol pasting
in the C pre-processor which makes the source hard to understand. For
example, it makes symbols hard to grep for.

@sbc100

sbc100 commented Apr 13, 2022

Copy link
Copy Markdown
Member Author

For now this change leaves the Z_ mangling in place. We can consider ways to remove that as a followup.

@sbc100
sbc100 requested review from binji and keithw April 13, 2022 23:37

@keithw keithw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % comments

Comment thread src/wasm2c.h.tmpl Resolved
Comment thread src/c-writer.cc Resolved
Comment thread src/tools/wasm2c.cc Resolved
Comment thread src/tools/wasm2c.cc Resolved
Comment thread src/tools/wasm2c.cc Resolved
Comment thread src/tools/wast2json.cc Resolved
Comment thread wasm2c/README.md Resolved
@sbc100
sbc100 force-pushed the default_wasm2c_prefix branch 2 times, most recently from 1484fb7 to adbbc9b Compare April 14, 2022 14:51
The module prefix is no longer optional and is now set by default to the
name of the module as given in the name section, or taken from the name
of the input file.

A new `-n/--module-name` command line flag can also be used to override.

The prefix used by the generated code is now fixed at wasm2c time which
makes the output code easier to read and also avoid the symbol pasting
in the C pre-processor which makes the source hard to understand.  For
example, it makes symbols hard to `grep` for.
@sbc100
sbc100 force-pushed the default_wasm2c_prefix branch from adbbc9b to ef0c3f2 Compare April 14, 2022 15:29
@sbc100
sbc100 enabled auto-merge (squash) April 14, 2022 15:35
@sbc100
sbc100 merged commit c3a1ce0 into main Apr 14, 2022
@sbc100
sbc100 deleted the default_wasm2c_prefix branch April 14, 2022 15:41
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.

2 participants