Skip to content

Consider a "backend" non-macro form for asm! #8

@petrochenkov

Description

@petrochenkov

Macros expanding directly into internal compiler structures (AST) are rather an exception in rustc than a rule.
The compiler frontend is in a process of migration to a token-based model (inspired by proc macros) where each macro expands to some actual non-macro syntax (token stream).

For inline assembly the surface syntax of that non-macro representation is not important right now, except that it should be unambiguous in the expression position, like extern break box { ... } or whatever.
It can probably be wordy or unwieldy to write manually, but not necessarily.

What's important in my opinion is ability to lower different surface asm syntaxes into this common non-macro representation.
Basically, if you are bikeshedding some asm!(syntax1) vs asm!(syntax2) alternative, make sure that both can be converted into a common non-macro form, so that the asm!(syntax2) alternative could always be implemented just as a different proc macro my_asm!(syntax2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions