Struct llhd::ir::UnitBuilder[][src]

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

A mutable function, process, or entity.

Implementations

Create a new builder for a unit.

Create a new builder for a unit that has not yet been added to a module.

Finish building and make the unit immutable again.

Get the unit’s mutable data.

Return the unit being built.

Add a new instruction using an InstBuilder.

Add a new instruction.

Delete an instruction.

Removes the instruction from the layout, data flwo graph, and control flow graph, and deletes it. The Inst is no longer valid afterwards.

Create a new BB.

Create a new named BB.

Delete a block.

Removes the block, and all its instructions, from the layout and control flow graph, deletes it. The Block is no longer valid afterwards.

Append all following instructions at the end of the unit.

Prepend all following instructions at the beginning of the unit.

Append all following instructions to the end of bb.

Prepend all following instructions to the beginning of bb.

Insert all following instructions after inst.

Insert all following instructions before inst.

Import an external unit for use within this unit.

Remove an instruction if its value is not being read.

Returns true if the instruction was removed.

Set the name of a BB.

Clear the name of a BB.

Set the anonymous name hint of a BB.

Clear the anonymous name hint of a BB.

Add a placeholder value.

This function is intended to be used when constructing PHI nodes.

Remove a placeholder value.

Set the name of a value.

Clear the name of a value.

Set the anonymous name hint of a value.

Clear the anonymous name hint of a value.

Replace all uses of a value with another.

Returns how many uses were replaced.

Replace the uses of a value with another, in a single instruction.

Returns how many uses were replaced.

Replace all uses of a block with another.

Returns how many blocks were replaced.

Replace all uses of a block with another, in a single instruction.

Returns how many blocks were replaced.

Remove all uses of a block.

Replaces all uses of the block with an invalid block placeholder, and removes phi node entries for the block.

Returns how many blocks were removed.

Remove all uses of a block, from a single instruction.

Replaces all uses of the block with an invalid block placeholder, and removes phi node entries for the block.

Returns how many blocks were removed.

Add a location hint to an instruction.

Annotates the byte offset of an instruction in the input file.

Basic Block Layout

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

Append a BB to the end of the function.

Prepend a BB to the beginning of a function.

This effectively makes bb the new entry block.

Insert a BB after another BB.

Insert a BB before another BB.

Remove a BB from the function.

Swap the position of two BBs.

Instruction Layout

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

Append an instruction to the end of a BB.

Prepend an instruction to the beginning of a BB.

Insert an instruction after another instruction.

Insert an instruction before another instruction.

Remove an instruction from the function.

Methods from Deref<Target = Unit<'a>>

Get the kind of this unit.

Trait Implementations

Immutably borrows from an owned value. Read more

The resulting type after dereferencing.

Dereferences the value.

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

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

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

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

Performs the mutable 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 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.