Skip to content

asm: customize Mnemonic and Display separately #11017

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

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

abrown
Copy link
Member

@abrown abrown commented Jun 11, 2025

Sometimes we just want to fix up the printed name of the instruction in the disassembly; e.g., instructions with the lock prefix. But, as we're seeing in #10836 and elsewhere, other times we want to control the printing of the entire instruction--the full Display implementation. We'll need this kind of thing if we want to swap the order of operands or omit an immediate if it ends up being included in the printed instruction name.

This change splits this kind of customization in two: Mnemonic and Display. After renaming this enum to Customization, all existing uses of Display are migrated to Mnemonic.

Sometimes we just want to fix up the printed name of the instruction in
the disassembly; e.g., instructions with the `lock` prefix. But, as
we're seeing in bytecodealliance#10836 and elsewhere, other times we want to control the
printing of the entire instruction--the full `Display` implementation.
We'll need this kind of thing if we want to swap the order of operands
or omit an immediate if it ends up being included in the printed
instruction name.

This change splits this kind of customization in two: `Mnemonic` and
`Display`. After renaming this enum to `Customization`, all existing
uses of `Display` are migrated to `Mnemonic`.
@abrown abrown requested a review from a team as a code owner June 11, 2025 21:54
@abrown abrown requested review from cfallin and alexcrichton and removed request for a team and cfallin June 11, 2025 21:54
@abrown
Copy link
Member Author

abrown commented Jun 11, 2025

cc: @rahulchaphalkar

@abrown abrown added this pull request to the merge queue Jun 11, 2025
Merged via the queue into bytecodealliance:main with commit a8e0d07 Jun 11, 2025
41 checks passed
@abrown abrown deleted the asm-full-custom-display branch June 11, 2025 22:37
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