Crate midenc_hir

Crate midenc_hir 

Source

Re-exports§

pub use self::itertools::IteratorExt;
pub use self::patterns::Rewriter;
pub use self::patterns::RewriterExt;
pub use hashbrown;
pub use midenc_hir_symbol as interner;

Modules§

adt
cfg
constants
demangle
derive
diagnostics
dialects
dominance
effects
entity
equivalence
formatter
itertools
loops
matchers
pass
patterns
print
traits
verifier
version

Macros§

define_attr_type
derive
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:
smallvec
Creates a SmallVec containing the arguments.

Structs§

AbiParam
Describes a function parameter or result.
ArrayAttr
ArrayType
A fixed-size, homogenous vector type.
Attribute
An Attribute associates some data with a well-known identifier (name).
AttributeSet
An AttributeSet is a uniqued collection of attributes associated with some IR entity
Backward
Block
Represents a basic block in the IR.
BlockArgument
A BlockArgument represents the definition of a Value by a block parameter
BlockId
The unique identifier for a Block
BlockOperand
A BlockOperand represents a use of a Block by an Operation
Context
Represents the shared state of the IR, used during a compilation session.
DialectInfo
DictAttr
DynHasher
EntityCursor
A cursor which provides read-only access to an EntityList.
EntityCursorMut
A cursor which provides mutable access to an EntityList.
EntityGroup
Represents size and range information for a contiguous grouping of entities in a vector.
EntityIter
EntityList
EntityMut
A guard that provides exclusive access to an IR entity
EntityProjection
Represents a projection of an EntityRef into an owned value.
EntityProjectionMut
Represents a projection of an EntityMut into an owned value.
EntityRange
A reference to a range of items in EntityStorage
EntityRangeMut
A mutable range of items in EntityStorage
EntityRef
A guard that ensures a reference to an IR entity cannot be mutably aliased
EntityStorage
EntityStorage provides an abstraction over storing IR entities in an crate::Operation.
Felt
Represents base field element in the field using Montgomery representation.
Forward
FunctionIdent
Represents a globally-unique module/function name pair, with corresponding source spans.
FunctionType
This represents the type of a function, i.e. it’s parameters and results, and expected calling convention.
FxBuildHasher
An implementation of BuildHasher that produces FxHashers.
FxHasher
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.
Ident
Represents an identifier in the IR.
InsertionGuard
KeyedSuccessorRange
KeyedSuccessorRangeMut
MaybeDefaultEntityIter
OpBuilder
OpOperandImpl
An OpOperand represents a use of a Value by an [Operation]
OpPrintingFlags
OpResult
An OpResult represents the definition of a Value by the result of an Operation
OpSuccessor
An OpSuccessor is a BlockOperand + OpOperandRange for that block
OpSuccessorMut
An OpSuccessorMut is a BlockOperand + OpOperandRangeMut for that block
Operation
The Operation struct provides the common foundation for all Op implementations.
OperationBuilder
The OperationBuilder is a primitive for imperatively constructing an [Operation].
OperationFolder
The OperationFolder is responsible for orchestrating operation folding, and the effects that folding an operation has on the containing region.
OperationName
The operation name, or mnemonic, that uniquely identifies an operation.
PointerType
A pointer to an object in memory
RawEntityRef
A RawEntityRef is an unsafe smart pointer type for IR entities allocated in a [Context].
Region
A region is a container for Block, in one of two forms:
RegionSuccessor
A RegionSuccessor represents the successor of a region.
RegionSuccessorIter
RegionTransformFailed
Report
Core Diagnostic wrapper type.
ReverseBlock
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.
Searcher
Searcher is a driver for Visitor impls as applied to some root Operation.
SetAttr
Signature
A Signature represents the type, ABI, and linkage of a function.
SmallStr
A CompactString is a compact string type that can be used almost anywhere a String or str can be used.
SmallVec
A Vec-like container that can store a small number of elements inline.
SourceSpan
This represents a span of bytes in a Miden Assembly source file.
Span
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.
StackOperand
This is an simple representation of a ValueRef on the Miden operand stack
StructField
This represents metadata about a field of a StructType
StructType
This represents a structured aggregate type
SuccessorInfo
This struct tracks successor metadata needed by crate::Operation
SuccessorOperandRange
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.
SuccessorOperandRangeMut
The mutable variant of [SuccessorOperandsRange].
SuccessorWithKey
SuccessorWithKeyMut
SymbolManager
This type provides high-level read-only symbol table operations for SymbolTable impls.
SymbolManagerMut
This type provides high-level read and write symbol table operations for SymbolTable impls.
SymbolMap
A SymbolMap is a low-level datastructure used in implementing a SymbolTable operation.
SymbolNameComponents
An iterator over SymbolNameComponent derived from a path symbol and leaf symbol.
SymbolPath
This type is a custom [Attribute] for [Symbol] references.
SymbolPathAttr
SymbolUse
A SymbolUse represents a use of a [Symbol] by an [Operation]
SymbolUseRefsIter
An iterator over SymbolUseRef which owns the collection it iterates over.
SymbolUsesIter
An iterator over SymbolUse which owns the collection it iterates over.
ValueId
A unique identifier for a Value in the IR
ValueOrAlias
This is a essentialy a ValueRef, but with a modified encoding that lets us uniquely identify aliases of a value on the operand stack during analysis.
WalkStage
Encodes the current walk stage for generic walkers.

Enums§

AddressSpace
The address space a pointer address is evaluated in.
ArgumentExtension
Represents how to extend a small integer value to native machine integer width.
ArgumentPurpose
Represents whether an argument or return value has a special purpose in the calling convention of a function.
CallConv
Represents the calling convention of a function.
Callable
A Callable represents a symbol or a value which can be used as a valid callee for a CallOpInterface implementation.
FoldResult
Represents the outcome of an attempt to fold an operation.
Immediate
InvalidAddressSpaceError
This error is raised when parsing an AddressSpace
InvalidSymbolPathError
InvalidSymbolRefError
InvocationBounds
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.
ListenerType
OpFoldResult
Represents a single result value of a folded operation.
Overflow
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.
Position
Represents the placement of inserted items relative to a ProgramPoint
ProgramPoint
ProgramPoint represents a specific location in the execution of a program.
RegionBranchPoint
This type represents a point being branched from in the methods of RegionBranchOpInterface.
RegionKind
Represents the types of regions that can be represented in the IR
RegionSuccessorInfo
This struct represents the metadata about a RegionBranchOpInterface successor, without borrowing the op or the successor.
SuccessorOperand
Represents an operand in a SuccessorOperands set.
SymbolNameComponent
A component of a namespaced SymbolName.
Symbols
This type is used to abstract over ownership of an immutable SymbolMap.
SymbolsMut
This type is used to abstract over ownership of an immutable SymbolMap.
Type
Represents the type of a value in the HIR type system
TypeRepr
This represents metadata about how a structured type will be represented in memory
ValueRange
An abstraction over the different type of Value-derived entity ranges, e.g. operands, results, block arguments, vs type-erased collections.
Visibility
The types of visibility that a [Symbol] may have
WalkOrder
The traversal order for a walk of a region, block, or operation
WalkResult
A result-like type used to control traversals of a [Walkable] entity.

Constants§

INLINE

Traits§

Alignable
This trait represents an alignable primitive integer value representing an address
AsSymbolRef
A trait which allows multiple types to be coerced into a SymbolRef.
AsValueRange
AttrPrinter
AttributeValue
BuildableOp
Builder
The Builder trait encompasses all of the functionality needed to construct and insert blocks and operations into the IR.
BuilderExt
CallOpInterface
A call-like operation is one that transfers control from one function to another.
CallableOpInterface
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.
Dialect
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.
DialectRegistration
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.
Direction
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.
DynHash
A type-erased version of core::hash::Hash
DynPartialEq
A type-erased version of PartialEq
Entity
A trait implemented by an IR entity
EntityId
A trait that must be implemented by the unique identifier for an Entity
EntityListItem
A trait implemented by any Entity that is storeable in an EntityList.
EntityParent
A trait implemented by an Entity that is a parent to one or more other Entity types.
EntityWithId
A trait implemented by an Entity that has a unique identifier
EntityWithParent
A trait implemented by an Entity that is a logical child of another entity type, and is stored in the parent using an EntityList.
FieldElement
Defines an element in a finite field.
KeyedSuccessor
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.
Listener
LoopLikeOpInterface
This trait is implemented by operations which have loop-like semantics.
Op
OpExt
OpPrinter
The OpPrinter trait is expected to be implemented by all [Op] impls as a prequisite.
OpRegistration
OpVerifier
The OpVerifier trait is expected to be implemented by all [Op] impls as a prequisite.
OpVisitor
Represents a visitor over Op of type T
OperationVisitor
Represents a visitor over Operation
RawWalk
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.
RegionBranchOpInterface
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.
RegionBranchTerminatorOpInterface
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.
RegionKindInterface
An op interface that indicates what types of regions it holds
SmallStrExt
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.
Spanned
This trait should be implemented for any type that has an associated SourceSpan.
StarkField
Defines an element in a STARK-friendly finite field.
StorableEntity
A trait implemented by an IR entity that can be stored in EntityStorage.
SuccessorOperands
This trait represents common behavior shared by any range of successor operands.
Symbol
A Symbol is an IR entity with an associated symbol, or name, which is expected to be unique amongst all other symbols in the same namespace.
SymbolTable
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.
SymbolVisitor
Represents a visitor over Symbol
ToSmallStr
A trait for converting a value to a CompactString.
ToSmallVec
Convenience trait for constructing a SmallVec
Usable
The Usable trait is implemented for IR entities which are defined and used, and as a result, require a data structure called the use-def list.
Value
Represents an SSA value in the IR.
Verify
The Verify trait represents verification logic associated with implementations of some trait.
Visitor
A generic trait that describes visitors for all kinds
Walk
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.
WalkMut
A mutable variant of Walk, for traversal which may mutate visited entities.

Functions§

generate_symbol_name
Generate a unique symbol name.

Type Aliases§

BlockArgumentRange
BlockArgumentRangeMut
BlockArgumentRef
A pointer to a BlockArgument
BlockCursor
A cursor into a BlockList
BlockCursorMut
A mutable cursor into a BlockList
BlockList
An intrusive, doubly-linked list of Block
BlockOperandRef
BlockRef
A pointer to a Block
DialectRegistrationHook
FxHashMap
FxHashSet
OpCursor
OpCursorMut
OpList
OpOperand
OpOperandList
OpOperandRange
OpOperandRangeMut
OpOperandStorage
OpResultRange
OpResultRangeMut
OpResultRef
A pointer to a OpResult
OpResultStorage
OpSuccessorRange
OpSuccessorRangeMut
OpSuccessorStorage
OperationRef
PostOrderBlockIter
An iterator over blocks produced by a depth-first, post-order visit of the CFG
PreOrderBlockIter
An iterator over blocks produced by a depth-first, pre-order visit of the CFG
RegionCursor
A cursor in a RegionList
RegionCursorMut
A mutable cursor in a RegionList
RegionList
An intrusive, doubly-linked list of Regions
RegionRef
SymbolName
Represents the name of a [Symbol] in its local [SymbolTable]
SymbolRef
SymbolTableRef
A type alias for SymbolTable implementations referenced via UnsafeIntrusiveEntityRef
SymbolUseCursor
SymbolUseCursorMut
SymbolUseIter
SymbolUseList
SymbolUseRef
UnsafeEntityRef
A raw pointer to an IR entity that has no associated metadata
UnsafeIntrusiveEntityRef
A raw pointer to an IR entity that has an intrusive linked-list link as its metadata
ValueRef
A pointer to a Value

Derive Macros§

Spanned