Crate leo_passes

Source
Expand description

ยงleo-passes

Crates.io Authors License

Modulesยง

code_generation ๐Ÿ”’
common ๐Ÿ”’
const_propagation ๐Ÿ”’
const_propagation_and_unrolling ๐Ÿ”’
dead_code_elimination ๐Ÿ”’
The Dead Code Elimination pass traverses the AST and eliminates unused code, specifically assignment statements, within the boundary of transitions and functions. The pass is run after the Function Inlining pass.
destructuring ๐Ÿ”’
The destructuring pass traverses the AST and destructures tuples into individual variables. This pass assumes that tuples have a depth of 1, which is ensured by the type checking pass.
flattening ๐Ÿ”’
The flattening pass traverses the AST after the SSA pass and converts into a sequential code. The pass flattens ConditionalStatements into a sequence of AssignStatements. The pass rewrites ReturnStatements into AssignStatements and consolidates the returned values as a single ReturnStatement at the end of the function. The pass rewrites ternary expressions over composite data types, into ternary expressions over the individual fields of the composite data type, followed by an expression constructing the composite data type. Note that this transformation is not applied to async functions.
function_inlining ๐Ÿ”’
The Function Inlining pass traverses the AST and inlines function at their call site. See https://en.wikipedia.org/wiki/Inline_expansion for more information. The pass also reorders Functions in a reconstructed ProgramScope so that they are in a post-order of the call graph. In other words, a callee function will appear before a caller function in the order.
loop_unrolling ๐Ÿ”’
monomorphization ๐Ÿ”’
Performs monomorphization of const generic functions within a ProgramScope.
pass ๐Ÿ”’
processing_script ๐Ÿ”’
static_analysis ๐Ÿ”’
static_single_assignment ๐Ÿ”’
The Static Single Assignment pass traverses the AST and converts it into SSA form. See https://en.wikipedia.org/wiki/Static_single-assignment_form for more information. The pass also replaces DefinitionStatements with AssignmentStatements. The pass also simplifies complex expressions into a sequence of AssignStatements. For example, (a + b) * c is rewritten into $var$1 = a + b; $var$2 = $var$1 * c.
symbol_table_creation ๐Ÿ”’
type_checking ๐Ÿ”’
write_transforming ๐Ÿ”’

Structsยง

Assigner
A struct used to create assignment statements.
AssignerInner
Contains the actual data for Assigner. Modeled this way to afford an API using interior mutability.
CodeGenerating
CompilerState
Contains data share by many compiler passes.
ConstPropagation
A pass to perform const propagation and folding.
ConstPropagationAndUnrolling
Pass that runs const propagation and loop unrolling until a fixed point.
ConstPropagationOutput
DeadCodeEliminating
DeadCodeEliminatingOutput
Destructuring
A pass to rewrite tuple creation and accesses into other code.
DiGraph
A directed graph.
Finalizer
Flattening
FunctionInlining
FunctionSymbol
Monomorphization
MonomorphizationOutput
ProcessingScript
A pass to validate (and remove) uses of interpret.
RenameTable
RenameTable tracks the names assigned by static single assignment in a single scope.
Replacer
A Replacer applies replacer to all Identifiers in an AST. Replacers are used to rename identifiers. Replacers are used to interpolate function arguments.
SsaForming
SsaFormingInput
StaticAnalyzing
SymbolTable
Maps global and local symbols to information about them.
SymbolTableCreation
A pass to fill the SymbolTable.
TypeChecking
A pass to check types.
TypeCheckingInput
Specify network limits for type checking.
TypeTable
A mapping between node IDs and their types.
Unrolling
UnrollingOutput
VariableSymbol
An entry for a variable in the symbol table.
WriteTransforming
A pass to rewrite assignments to array accesses and struct accesses.

Enumsยง

DiGraphError
Errors in directed graph operations.
VariableType
An enumeration of the different types of variable type.

Traitsยง

Node
A node in a graph.
Pass
A compiler pass.

Type Aliasesยง

CallGraph
A call graph.
ConditionalTreeNode
A binary search tree to store all paths through nested conditional blocks.
ImportGraph
An import dependency graph.
StructGraph
A struct dependency graph.