Expand description
§pliron: Programming Languages Intermediate RepresentatiON
pliron
is an extensible compiler IR framework, inspired by MLIR
and written in safe Rust.
Re-exports§
pub use pliron_derive as derive;
Modules§
- attribute
- Attributes are non-SSA data stored in Operations.
- basic_
block - A BasicBlock is a list of Operations.
- builtin
- Builtin dialect: Ops, Types and Attributes
- common_
traits - Utility traits such as Named, Verify etc.
- context
- Context and Ptr together provide memory management for
pliron
. - debug_
info - Utilities for attaching / retrieving debug info to / from the IR.
- dialect
- Dialects are a mechanism to group related Ops, Types and Attributes.
- graph
- IR and control-flow-graph utilities
- identifier
- Identifiers are strings used to name entities in programming languages.
- irfmt
- IR printing and parsing utilities
- linked_
list - Provide linked-list operations for
Ptr<T: LinkedList>
. - location
- Source location for different IR entities
- op
- An Op is a thin wrapper arround an Operation, providing API specific to the OpId of that Operation.
- operation
- An operation is the basic unit of execution in the IR. The general idea is similar to MLIR’s Operation
- parsable
- IR objects that can be parsed from their text representation.
- printable
- IR objects that are to be printed must implement Printable.
- region
- Regions are containers for BasicBlocks within an Operation.
- result
- Utilities for error handling
- storage_
uniquer - Store unique instances of a rust type.
- symbol_
table - Utilities to work with SymbolTableInterface Ops.
- type
- Every SSA value, such as operation results or block arguments has a type defined by the type system.
- uniqued_
any - Store, in Context, a single unique copy of any object.
- utils
- Independent support tools / utilities
- value
- SSA Values: Use-Def and Def-Use Graph. At the core of the IR infrastructure are SSA def-use and use-def chains. Use-def and def-use chains are composed of four key structures:
Macros§
- arg_err
- Create ErrorKind::InvalidArgument Result from any std::error::Error object. To create Error, use arg_error! instead. The macro also accepts format! like arguments to create one-off errors.
- arg_
err_ noloc - Same as arg_err but when no location is known.
- arg_
error - Create ErrorKind::InvalidArgument Error from any std::error::Error object. To create Result, use arg_err! instead. The macro also accepts format! like arguments to create one-off errors.
- arg_
error_ noloc - Same as arg_error but when no location is known.
- create_
err - Specify ErrorKind and create Result from any std::error::Error object. To create Error, use create_error! instead. The macro also accepts format! like arguments to create one-off errors. It may be shorter to just use verify_err!, input_err! or arg_err! instead.
- create_
error - Specify ErrorKind and create Error from any std::error::Error object. To create Result, use create_err! instead. The macro also accepts format! like arguments to create one-off errors. It may be shorter to just use verify_error!, input_error! or arg_error! instead.
- impl_
canonical_ syntax - Shorthand for defining a canonical syntax Printable and Parsable for an Op
- impl_
printable_ for_ display - Implement Printable for a type that already implements Display. Example:
- impl_
verify_ succ - Sugar to implement a verifier that always succeeds. Usage:
- indented_
block - All statements in the block are indented during fmt. Simply wraps the block with State::push_indent and State::pop_indent.
- input_
err - Create ErrorKind::InvalidInput Result from any std::error::Error object. To create Error, use input_error! instead. The macro also accepts format! like arguments to create one-off errors.
- input_
err_ noloc - Same as input_err but when no location is known.
- input_
error - Create ErrorKind::InvalidInput Error from any std::error::Error object. To create Result, use input_err! instead. The macro also accepts format! like arguments to create one-off errors.
- input_
error_ noloc - Same as input_error but when no location is known.
- type_
to_ trait - Specify that a type may be casted to a
dyn Trait
object. Use any_to_trait for the actual cast. Example: - verify_
err - Create ErrorKind::VerificationFailed Result from any std::error::Error object. To create Error, use verify_error! instead. The macro also accepts format! like arguments to create one-off errors.
- verify_
err_ noloc - Same as verify_err but when no location is known.
- verify_
error - To create Result, use verify_err! instead. The macro also accepts format! like arguments to create one-off errors.
- verify_
error_ noloc - Same as verify_error but when no location is known.