This macro is used to generate the boilerplate for operation trait implementations.
Super traits have to be declared as a comma separated list of traits, instead of the traditional
“+” separated list of traits.
Example:
A speedy hash algorithm for use within rustc. The hashmap in liballoc
by default uses SipHash which isn’t quite as speedy as we want. In the
compiler we’re not really worried about DOS attempts, so we use a fast
non-cryptographic hash.
A custom [WalkDirectionImpl] that is the same as [Forward], except the operations of each block
are visited bottom-up, i.e. as if [Backward] applied just to Block.
This type is used to wrap any T with a SourceSpan, and is typically used when it is not
convenient to add a SourceSpan to the type - most commonly because we don’t control the type.
This type models how operands are forwarded to block arguments in control flow. It consists of a
number, denoting how many of the successor block arguments are produced by the operation,
followed by a range of operands that are forwarded. The produced operands are passed to the
first few block arguments of the successor, followed by the forwarded operands. It is
unsupported to pass them in a different order.
This type represents upper and lower bounds on the number of times a region of a
RegionBranchOpInterface op can be invoked. The lower bound is at least zero, but the upper
bound may not be known.
This enumeration represents the various ways in which arithmetic operations
can be configured to behave when either the operands or results over/underflow
the range of the integral type.
A callable operation is one who represents a potential function, and may be a target for a call-
like operation (i.e. implementations of CallOpInterface). These operations may be traditional
function ops (i.e. Function), as well as function reference-producing operations, such as an
op that creates closures, or captures a function by reference.
A Dialect represents a collection of IR entities that are used in conjunction with one
another. Multiple dialects can co-exist or be mutually exclusive. Converting between dialects
is the job of the conversion infrastructure, using a process called legalization.
A DialectRegistration must be implemented for any implementation of Dialect, to allow the
dialect to be registered with a crate::Context and instantiated on demand when building ops
in the IR.
A marker trait for abstracting over the direction in which a traversal is performed, or
information is propagated by an analysis, i.e. forward or backward.
This trait represents successor-like values for operations, with support for control-flow
predicated on a “key”, a sentinel value that must match in order for the successor block to be
taken.
RawWalk is a variation of Walk/WalkMut that performs the traversal while ensuring that
no entity is borrowed when visitor callbacks are invoked. This allows the visitor to freely
obtain mutable/immutable borrows without having to worry if the traversal is holding a borrow
somewhere.
This interface provides information for region operations that exhibit branching behavior
between held regions. I.e., this interface allows for expressing control flow information for
region holding operations.
This interface provides information for branching terminator operations in the presence of a
parent RegionBranchOpInterface implementation. It specifies which operands are passed to which
successor region.
A trait that provides convenience methods for creating a CompactString from a collection of
items. It is implemented for all types that can be converted into an iterator, and that iterator
yields types that can be converted into a str.
A SymbolTable is an IR entity which contains other IR entities, called symbols, each of
which has a name, aka symbol, that uniquely identifies it amongst all other entities in the
same SymbolTable.
Walk represents an implementation of a depth-first traversal (pre- or post-order) from some
root object in the entity graph, to children of a given entity type.