Expand description
Shared traits, types, and macros for Peepmatic.
This crate is used both at build time when constructing peephole optimizers
(i.e. in the peepmatic crate), and at run time when using pre-built
peephole optimizers (i.e. in the peepmatic-runtime crate and in
Cranelift’s Peepmatic integration at cranelift/codegen/src/peepmatic.rs).
This crate is similar to a header file: it should generally only contain trait/type/macro definitions, not any code.
Macros§
- define_
operator - Define an operator type, as well as its parsing and typing rules.
- define_
parse_ and_ typing_ rules_ for_ operator - Define both a
wast::parser::Parseimplementation and apeepmatic_traits::TypingRulesimplementation for the given operator type. - define_
parse_ impl_ for_ operator - Define a
wast::parser::Parseimplementation for an operator type. - define_
typing_ rules_ impl_ for_ operator - Define a
peepmatic_traits::TypingRulesimplementation for the given operator type.
Traits§
- Typing
Context - A trait to represent a typing context.
- Typing
Rules - The typing rules for a
TOperatortype.
Functions§
- unsupported
- Raise a panic about an unsupported operation.