[−][src]Struct llhd::ir::FunctionLayout
Determines the order of instructions and BBs in a Function
or Process
.
Methods
impl FunctionLayout
[src]
impl FunctionLayout
[src]
Basic block arrangement.
The following functions are used for laying out the basic blocks within a
Function
or Process
.
pub fn append_block(&mut self, bb: Block)
[src]
Append a BB to the end of the function.
pub fn prepend_block(&mut self, bb: Block)
[src]
Prepend a BB to the beginning of a function.
This effectively makes bb
the new entry block.
pub fn insert_block_after(&mut self, bb: Block, after: Block)
[src]
Insert a BB after another BB.
pub fn insert_block_before(&mut self, bb: Block, before: Block)
[src]
Insert a BB before another BB.
pub fn remove_block(&mut self, bb: Block)
[src]
Remove a BB from the function.
pub fn swap_blocks(&mut self, bb0: Block, bb1: Block)
[src]
Swap the position of two BBs.
pub fn blocks<'a>(&'a self) -> impl Iterator<Item = Block> + 'a
[src]
Return an iterator over all BBs in layout order.
pub fn first_block(&self) -> Option<Block>
[src]
Get the first BB in the layout. This is the entry block.
pub fn last_block(&self) -> Option<Block>
[src]
Get the last BB in the layout.
pub fn prev_block(&self, bb: Block) -> Option<Block>
[src]
Get the BB preceding bb
in the layout.
pub fn next_block(&self, bb: Block) -> Option<Block>
[src]
Get the BB following bb
in the layout.
pub fn entry(&self) -> Block
[src]
Get the entry block in the layout.
The fallible alternative is first_block(bb)
.
impl FunctionLayout
[src]
Instruction arrangement.
The following functions are used for laying out the instructions within a
Function
or Process
.
pub fn inst_block(&self, inst: Inst) -> Option<Block>
[src]
Get the BB which contains inst
, or None
if inst
is not inserted.
pub fn append_inst(&mut self, inst: Inst, bb: Block)
[src]
Append an instruction to the end of a BB.
pub fn prepend_inst(&mut self, inst: Inst, bb: Block)
[src]
Prepend an instruction to the beginning of a BB.
pub fn insert_inst_after(&mut self, inst: Inst, after: Inst)
[src]
Insert an instruction after another instruction.
pub fn insert_inst_before(&mut self, inst: Inst, before: Inst)
[src]
Insert an instruction before another instruction.
pub fn remove_inst(&mut self, inst: Inst)
[src]
Remove an instruction from the function.
pub fn insts<'a>(&'a self, bb: Block) -> impl Iterator<Item = Inst> + 'a
[src]
Return an iterator over all instructions in a block in layout order.
pub fn first_inst(&self, bb: Block) -> Option<Inst>
[src]
Get the first instruction in the layout.
pub fn last_inst(&self, bb: Block) -> Option<Inst>
[src]
Get the last instruction in the layout.
pub fn prev_inst(&self, inst: Inst) -> Option<Inst>
[src]
Get the instruction preceding inst
in the layout.
pub fn next_inst(&self, inst: Inst) -> Option<Inst>
[src]
Get the instruction following inst
in the layout.
pub fn terminator(&self, bb: Block) -> Inst
[src]
Get the terminator instruction in the layout.
The fallible alternative is last_inst(bb)
.
Trait Implementations
impl Default for FunctionLayout
[src]
fn default() -> FunctionLayout
[src]
impl<'de> Deserialize<'de> for FunctionLayout
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Layout for FunctionLayout
[src]
fn is_inst_inserted(&self, inst: Inst) -> bool
[src]
fn is_block_inserted(&self, bb: Block) -> bool
[src]
impl Serialize for FunctionLayout
[src]
Auto Trait Implementations
impl RefUnwindSafe for FunctionLayout
impl Send for FunctionLayout
impl Sync for FunctionLayout
impl Unpin for FunctionLayout
impl UnwindSafe for FunctionLayout
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,