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.
- Utilities for error handling
- Identifiers are strings used to name entities in programming languages.
- Provide linked-list operations for
Ptr<T: LinkedList>
. - Source location for different IR entities
- 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.
- Infrastructure for casting from
dyn Any
todyn Trait
, for traits that the type contained by the Any object implements. - Every SSA value, such as operation results or block arguments has a type defined by the type system.
- Store, in Context, a single unique copy of any object.
- Use-Def and Def-Use Graph.
- Extend functionality of Rust vectors.
- Walk the IR graph. At each node:
Macros§
- Create an ErrorKind::InvalidArgument error from any std::error::Error object. The macro also accepts format! like arguments to create one-off errors.
- Same as arg_err but when no location is known.
- 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.
- 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 - Sugar to implement a verifier that always succeeds. Usage:
- 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.
- Same as input_err but when no location is known.
- Specify that a type may be casted to a
dyn Trait
object. Use any_to_trait for the actual cast. Example: - Create an ErrorKind::VerificationFailed error from any std::error::Error object. The macro also accepts format! like arguments to create one-off errors.
- Same as verify_err but when no location is known.
Structs§
- A value which is initialized on the first access.