Attribute Macros§
- attr_
interface - Declare an Attribute interface,
which can be implemented by any
Attribute. - attr_
interface_ impl - Implement Attribute Interface for an Attribute.
The interface trait must define a
verifyfunction with type AttrInterfaceVerifier. - def_
attribute #[def_attribute(...)]: Annotate a Rust struct as a new IR attribute.- def_op
#[def_op(...)]: Create a new IR operation.- def_
type #[def_type(...)]: Annotate a Rust struct as a new IR type.- derive_
attr_ get_ set - Derive getter and setters for operation attributes listed as arguments. The arguments are a comma separated list of attribute names (which must be an Identifier), each of which may have an optional concrete Rust type specified, denoting the Attribute’s concrete type.
- derive_
op_ interface_ impl - Derive implementation of an Op Interface for an Op. Note that an impl can be derived only for those interfaces that do not require any methods to be defined during the impl.
- derive_
type_ get - Derive get methods for types that retrieve interned types.
- format
- Derive Printable and
Parsable for Rust types.
Use this is for types other than
Op,TypeandAttributes. - format_
attribute - Derive Printable and Parsable for Attributes
- format_
op - Derive Printable and
Parsable for Ops
This derive only supports a syntax in which results appear before the opid:
res1, ... = opid ...The format string specifies what comes after the opid. - format_
type - Derive Printable and Parsable for Types
- op_
interface - Declare an Op interface, which can be implemented
by any
Op. - op_
interface_ impl - Implement Op Interface for an Op. The interface trait must define
a
verifyfunction with type OpInterfaceVerifier - type_
interface - Declare a Type interface,
which can be implemented by any
Type. - type_
interface_ impl - Implement Type Interface for a Type.
The interface trait must define a
verifyfunction with type TypeInterfaceVerifier.