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 that has not yet been added to a module.
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 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.
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.
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>>
Trait Implementations
type Output = ExtUnitData
type Output = ExtUnitData
The returned type after indexing.
Performs the indexing (container[index]
) operation. Read more
Performs the mutable indexing (container[index]
) operation. Read more