You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor wasmprinter to rely less on a String output (#1592)
* Refactor how operand immediates are printed
Delegate the space-before-immediate to printing the immediate itself
rather than forcing a space between each immediate. Avoids the need to
`pop()` or otherwise test if space is already present in situations
where immediates are omitted.
* Add a test exercising labels
* Update how operators are printed in `wasmprinter`
Previously operators were printed to a temporary buffer and then
depending on what happened it would conditionally go into the actual
module or instead be discarded (e.g. the last `end`). This commit
refactors to instead avoid a temporary buffer entirely and
unconditionally emit instructions to the real output. This is done by
restructuring the printing slightly by having "before_op" and "after_op"
hooks while printing which are used to manage nesting/newlines instead
of the outer loop in the main printer. This is combined with a few other
minor things such as a `is_end_then_eof` method which is used to avoid
printing the final `end`.
One minor test update happened here with a `delegate` instruction from
the legacy exception-handling proposal which I think is a bugfix given
my read of the older proposal.
* Review comments
0 commit comments