Expand description
pliron: Programming Languages Intermediate RepresentatiON
pliron
is an extensible compiler IR framework, inspired by MLIR
and written in safe Rust.
Modules
- Attributes are non-SSA data stored in Operations.
- A BasicBlock is a list of Operations.
- Utilities for attaching / retrieving debug info to / from the IR.
- Various dialects that are part of
pliron
. These may be separated into different crates in the future. - Utilities for error handling
- Provide linked-list operations for
Ptr<T: LinkedList>
. - An operation is the basic unit of execution in the IR. The general idea is similar to MLIR’s Operation
- IR objects that can be parsed from their text representation.
- IR objects that are to be printed must implement Printable.
- Regions are containers for BasicBlocks within an Operation.
- Store unique instances of a rust type.
- Every SSA value, such as operation results or block arguments has a type defined by the type system.
- Use-Def and Def-Use Graph.
- Extend functionality of Rust vectors.
Macros
- Specify ErrorKind and create an error from any std::error::Error object. The macro also accepts format! like arguments to create one-off errors. It may be shorter to just use verify_err! or input_err! instead.
- Declare an Op
- impl Attribute for a rust type.
- Implement an Attribute Interface for an Attribute. The interface trait must define a
verify
function with type AttrInterfaceVerifier. - Implement an Op Interface for an Op. The interface trait must define a
verify
function with type OpInterfaceVerifier - impl Type for a rust type
- All statements in the block are indented during fmt. Simply wraps the block with State::push_indent and State::pop_indent.
- Create an ErrorKind::InvalidInput error from any std::error::Error object. The macro also accepts format! like arguments to create one-off errors.
- Create an ErrorKind::VerificationFailed error from any std::error::Error object. The macro also accepts format! like arguments to create one-off errors.