[−][src]Trait llhd::ir::UnitBuilder
A temporary object used to populate a Function
, Process
or Entity
.
Associated Types
Loading content...Required methods
fn unit(&self) -> &Self::Unit
Return the unit being built.
fn unit_mut(&mut self) -> &mut Self::Unit
Return the mutable unit being built.
fn build_inst(&mut self, data: InstData, ty: Type) -> Inst
Add a new instruction.
fn remove_inst(&mut self, inst: Inst)
Remove an instruction.
fn block(&mut self) -> Block
Create a new BB.
Panics if the unit is an Entity
.
fn insert_at_end(&mut self)
Append all following instructions at the end of the unit.
Panics if the unit is a Function
or Process
.
fn insert_at_beginning(&mut self)
Prepend all following instructions at the beginning of the unit.
Panics if the unit is a Function
or Process
.
fn append_to(&mut self, bb: Block)
Append all following instructions to the end of bb
.
Panics if the unit is an Entity
.
fn prepend_to(&mut self, bb: Block)
Prepend all following instructions to the beginning of bb
.
Panics if the unit is an Entity
.
fn insert_after(&mut self, inst: Inst)
Insert all following instructions after inst
.
fn insert_before(&mut self, inst: Inst)
Insert all following instructions before inst
.
Provided methods
fn ins(&mut self) -> InstBuilder<&mut Self>
Add a new instruction using an InstBuilder
.
fn dfg(&self) -> &DataFlowGraph
Get the DFG of the unit being built.
fn dfg_mut(&mut self) -> &mut DataFlowGraph
Get the mutable DFG of the unit being built.
fn cfg(&self) -> &ControlFlowGraph
Get the CFG of the unit being built.
fn cfg_mut(&mut self) -> &mut ControlFlowGraph
Get the mutable CFG of the unit being built.
fn add_extern(&mut self, name: UnitName, sig: Signature) -> ExtUnit
Import an external unit for use within this unit.
fn prune_if_unused(&mut self, inst: Inst)
Remove an instruction if its value is not being read.