[][src]Crate llhd

The Low Level Hardware Description language. This library provides tools to create, modify, store, and load LLHD graphs.

Re-exports

pub use self::InstKind::*;
pub use self::TypeKind::*;

Modules

assembly

Facilities to emit a module as human-readable assembly, or to parse such assembly back into a module.

opt

This module implements optimization passes that transform LLHD descriptions.

util

Various utility functions that fit nowhere else.

Structs

Argument

A function argument or process/entity input or output.

ArgumentRef
ArrayAggregate

An array aggregate value such as [42 x i64 1337].

Block

A basic block.

BlockRef
ConstInt

A constant integer value.

ConstTime

A constant time value.

Entity

An entity. Describes through its instructions the data dependencies in order to react to changes in input signals. Implements data flow and timed execution.

EntityContext
EntityRef
Function

A function. Sequentially executes instructions to determine a result value from its inputs. Implements control flow and immediate execution.

FunctionContext
FunctionRef
Inst
InstIter
InstRef
Module
ModuleContext
Process

A process. Sequentially executes instructions to react to changes in input signals. Implements control flow and timed execution.

ProcessContext
ProcessRef
SeqBody

A sequential body of blocks and instructions. Represents a control flow graph as describe by a process or function, i.e. a sequential arrangement of instructions. This in contrast to the dataflow body of an entity.

StructAggregate

A struct aggregate value such as {i32 42, i64 9001}.

ValueId

A unique identifier assigned to each value node in the graph. These IDs are wrapped specific ValueRef variants to refer to values in the graph.

Enums

AggregateKind

The different forms an aggregate can take.

BinaryMnemonic
BinaryOp
BlockPosition

A relative position of a block. Used to insert or move a block to a position relative to the surrounding unit or another block.

BranchKind

The branch flavor.

CompareOp
ConstKind
InstKind

The different forms an instruction can take.

InstPosition

A relative position of an instruction. Used to insert or move an instruction to a position relative to the surrounding unit, block, or another instruction.

Mnemonic
ReturnKind

The return instruction flavor.

SliceMode

The insert/extract flavor.

TypeKind

The different kinds of types.

UnaryMnemonic
UnaryOp
ValueRef

A reference to a value in a module.

Constants

INLINE_VALUE_ID

The ID of inline values such as constants.

Traits

AsContext
AsUnitContext
Context

A context is anything that can resolve the name and type of a ValueRef. Contexts are expected to form a hierarchy, such that a context wrapping e.g. a function falls back to a parent context wrapping the module if a value cannot be appropriately resolved.

SequentialContext

A context wrapping a unit that uses basic blocks to group a sequence of instructions.

UnitContext

A context wrapping a unit.

Value
Visitor

A trait to implement the visitor pattern on an LLHD graph.

Functions

array_ty

Create a array type. size is the number of elements in the array, and ty the type of each individual element.

const_int

Create a new integer constant.

const_time

Create a new time constant.

const_zero

Create a constant zero value of the requested type. Panics if there is no zero value for the given type.

entity_ty

Create an entity type with the given input and output arguments.

enum_ty

Create an enum type of the requested size.

func_ty

Create a function type with the given arguments and return type.

int_ty

Create an integer type of the requested size.

pointer_ty

Create a pointer type with the requested data type.

signal_ty

Create a signal type with the requested data type.

struct_ty

Create a struct type. fields is an list of types, one for each field.

time_ty

Create a time type.

void_ty

Create a void type.

Type Definitions

Aggregate

An aggregate value.

Const
Type