Struct llhd::ir::Unit[][src]

pub struct Unit<'a> { /* fields omitted */ }
Expand description

An immutable function, process, or entity.

Implementations

Create a new unit wrapper around raw unit data.

Create a new unit wrapper around raw unit data that has not been added to a module yet.

Get the unit’s id.

Get the unit’s data.

Get the kind of this unit.

Get the unit’s signature.

Get the unit’s name.

👎 Deprecated since 0.13.0:

simply drop the dump()

Dump the unit in human-readable form.

Panic if the unit is not well-formed.

Check if this unit is a Function.

Check if this unit is a Process.

Check if this unit is an Entity.

Return an iterator over the unit’s input arguments.

Return an iterator over the unit’s output arguments.

Return an iterator over the unit’s arguments.

Get the input argument at position pos.

Get the output argument at position pos.

Return the name of an external unit.

Return the signature of an external unit.

Return an iterator over the external units used by this unit.

Compute the unit’s temporal region graph.

Compute the unit’s block predecessor table.

Compute the unit’s temporal block predecessor table.

Compute the unit’s dominator tree.

Compute the unit’s temporal dominator tree.

Compute the unit’s dominator tree, if a predecessor table is already available.

Return the name of a BB.

Return the anonymous name hint of a BB.

Check if a value is a placeholder.

Returns whether an instruction produces a result.

Returns the result of an instruction.

Returns the result of an instruction.

Returns the value of an argument.

Returns the type of a value.

Returns the type of an instruction.

Return the argument that produces value.

Return the argument that produces value, or panic.

Return the instruction that produces value.

Return the instruction that produces value, or panic.

Return the name of a value.

Return the anonymous name hint of a value.

Iterate over all uses of a value.

Check if a value is used.

Check if a value has exactly one use.

Resolve a constant value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

Resolve a constant time value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

Resolve a constant integer value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

Resolve a constant array value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

Resolve a constant struct value.

Returns None if the value is not constant. Note that this does not perform constant folding. Rather, the value must resolve to an instruction which produces a constant value.

Get the location hint associated with an instruction.

Returns the byte offset of the instruction in the input file, or None if there is no hint for the instruction.

Get the block ID bound.

This function is useful for creating dense vectors to associate data with blocks.

Basic Block Layout

The following functions are used to query the basic block layout.

Return an iterator over all BBs in layout order.

Check if a block is inserted into the layout.

Get the first BB in the layout. This is the entry block.

Get the last BB in the layout.

Get the BB preceding bb in the layout.

Get the BB following bb in the layout.

Get the entry block in the layout.

The fallible alternative is first_block(bb).

Instruction Layout

The following functions are used to query the instruction layout within a block.

Get the BB which contains inst, or None if inst is not inserted.

Return an iterator over all instructions in a block in layout order.

Return an iterator over all instructions in layout order.

Check if an instruction is inserted into the layout.

Get the first instruction in the layout.

Get the last instruction in the layout.

Get the instruction preceding inst in the layout.

Get the instruction following inst in the layout.

Get the terminator instruction in the layout.

The fallible alternative is last_inst(bb).

Trait Implementations

Immutably borrows from an owned value. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.