Crate pliron

Source
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.