Struct cranelift_codegen::cursor::FuncCursor [−][src]
pub struct FuncCursor<'f> {
pub func: &'f mut Function,
// some fields omitted
}Function cursor.
A FuncCursor holds a mutable reference to a whole ir::Function while keeping a position
too. The function can be re-borrowed by accessing the public cur.func member.
This cursor is for use before legalization. The inserted instructions are not given an encoding.
Fields
func: &'f mut Function
The referenced function.
Methods
impl<'f> FuncCursor<'f>[src]
impl<'f> FuncCursor<'f>pub fn new(func: &'f mut Function) -> FuncCursor<'f>[src]
pub fn new(func: &'f mut Function) -> FuncCursor<'f>Create a new FuncCursor pointing nowhere.
pub fn use_srcloc(&mut self, inst: Inst)[src]
pub fn use_srcloc(&mut self, inst: Inst)Use the source location of inst for future instructions.
pub fn ins(&mut self) -> InsertBuilder<&mut FuncCursor<'f>>[src]
pub fn ins(&mut self) -> InsertBuilder<&mut FuncCursor<'f>>Create an instruction builder that inserts an instruction at the current position.
Trait Implementations
impl<'f> Cursor for FuncCursor<'f>[src]
impl<'f> Cursor for FuncCursor<'f>fn position(&self) -> CursorPosition[src]
fn position(&self) -> CursorPositionGet the current cursor position.
fn set_position(&mut self, pos: CursorPosition)[src]
fn set_position(&mut self, pos: CursorPosition)Set the current position.
fn srcloc(&self) -> SourceLoc[src]
fn srcloc(&self) -> SourceLocGet the source location that should be assigned to new instructions.
fn set_srcloc(&mut self, srcloc: SourceLoc)[src]
fn set_srcloc(&mut self, srcloc: SourceLoc)Set the source location that should be assigned to new instructions.
fn layout(&self) -> &Layout[src]
fn layout(&self) -> &LayoutBorrow a reference to the function layout that this cursor is navigating.
fn layout_mut(&mut self) -> &mut Layout[src]
fn layout_mut(&mut self) -> &mut LayoutBorrow a mutable reference to the function layout that this cursor is navigating.
fn with_srcloc(self, srcloc: SourceLoc) -> Self where
Self: Sized, [src]
fn with_srcloc(self, srcloc: SourceLoc) -> Self where
Self: Sized, Exchange this cursor for one with a set source location. Read more
fn at_position(self, pos: CursorPosition) -> Self where
Self: Sized, [src]
fn at_position(self, pos: CursorPosition) -> Self where
Self: Sized, Rebuild this cursor positioned at pos.
fn at_inst(self, inst: Inst) -> Self where
Self: Sized, [src]
fn at_inst(self, inst: Inst) -> Self where
Self: Sized, Rebuild this cursor positioned at inst. Read more
fn at_first_insertion_point(self, ebb: Ebb) -> Self where
Self: Sized, [src]
fn at_first_insertion_point(self, ebb: Ebb) -> Self where
Self: Sized, Rebuild this cursor positioned at the first insertion point for ebb. This differs from at_first_inst in that it doesn't assume that any instructions have been inserted into ebb yet. Read more
fn at_first_inst(self, ebb: Ebb) -> Self where
Self: Sized, [src]
fn at_first_inst(self, ebb: Ebb) -> Self where
Self: Sized, Rebuild this cursor positioned at the first instruction in ebb. Read more
fn at_last_inst(self, ebb: Ebb) -> Self where
Self: Sized, [src]
fn at_last_inst(self, ebb: Ebb) -> Self where
Self: Sized, Rebuild this cursor positioned at the last instruction in ebb. Read more
fn after_inst(self, inst: Inst) -> Self where
Self: Sized, [src]
fn after_inst(self, inst: Inst) -> Self where
Self: Sized, Rebuild this cursor positioned after inst. Read more
fn at_top(self, ebb: Ebb) -> Self where
Self: Sized, [src]
fn at_top(self, ebb: Ebb) -> Self where
Self: Sized, Rebuild this cursor positioned at the top of ebb. Read more
fn at_bottom(self, ebb: Ebb) -> Self where
Self: Sized, [src]
fn at_bottom(self, ebb: Ebb) -> Self where
Self: Sized, Rebuild this cursor positioned at the bottom of ebb. Read more
fn current_ebb(&self) -> Option<Ebb>[src]
fn current_ebb(&self) -> Option<Ebb>Get the EBB corresponding to the current position.
fn current_inst(&self) -> Option<Inst>[src]
fn current_inst(&self) -> Option<Inst>Get the instruction corresponding to the current position, if any.
fn goto_after_inst(&mut self, inst: Inst)[src]
fn goto_after_inst(&mut self, inst: Inst)Go to the position after a specific instruction, which must be inserted in the layout. New instructions will be inserted after inst. Read more
fn goto_inst(&mut self, inst: Inst)[src]
fn goto_inst(&mut self, inst: Inst)Go to a specific instruction which must be inserted in the layout. New instructions will be inserted before inst. Read more
fn goto_first_insertion_point(&mut self, ebb: Ebb)[src]
fn goto_first_insertion_point(&mut self, ebb: Ebb)Go to the position for inserting instructions at the beginning of ebb, which unlike goto_first_inst doesn't assume that any instructions have been inserted into ebb yet. Read more
fn goto_first_inst(&mut self, ebb: Ebb)[src]
fn goto_first_inst(&mut self, ebb: Ebb)Go to the first instruction in ebb.
fn goto_last_inst(&mut self, ebb: Ebb)[src]
fn goto_last_inst(&mut self, ebb: Ebb)Go to the last instruction in ebb.
fn goto_top(&mut self, ebb: Ebb)[src]
fn goto_top(&mut self, ebb: Ebb)Go to the top of ebb which must be inserted into the layout. At this position, instructions cannot be inserted, but next_inst() will move to the first instruction in ebb. Read more
fn goto_bottom(&mut self, ebb: Ebb)[src]
fn goto_bottom(&mut self, ebb: Ebb)Go to the bottom of ebb which must be inserted into the layout. At this position, inserted instructions will be appended to ebb. Read more
fn next_ebb(&mut self) -> Option<Ebb>[src]
fn next_ebb(&mut self) -> Option<Ebb>Go to the top of the next EBB in layout order and return it. Read more
fn prev_ebb(&mut self) -> Option<Ebb>[src]
fn prev_ebb(&mut self) -> Option<Ebb>Go to the bottom of the previous EBB in layout order and return it. Read more
fn next_inst(&mut self) -> Option<Inst>[src]
fn next_inst(&mut self) -> Option<Inst>Move to the next instruction in the same EBB and return it. Read more
fn prev_inst(&mut self) -> Option<Inst>[src]
fn prev_inst(&mut self) -> Option<Inst>Move to the previous instruction in the same EBB and return it. Read more
fn insert_inst(&mut self, inst: Inst)[src]
fn insert_inst(&mut self, inst: Inst)Insert an instruction at the current position. Read more
fn remove_inst(&mut self) -> Inst[src]
fn remove_inst(&mut self) -> InstRemove the instruction under the cursor. Read more
fn remove_inst_and_step_back(&mut self) -> Inst[src]
fn remove_inst_and_step_back(&mut self) -> InstRemove the instruction under the cursor. Read more
fn insert_ebb(&mut self, new_ebb: Ebb)[src]
fn insert_ebb(&mut self, new_ebb: Ebb)Insert an EBB at the current position and switch to it. Read more
impl<'c, 'f> InstInserterBase<'c> for &'c mut FuncCursor<'f>[src]
impl<'c, 'f> InstInserterBase<'c> for &'c mut FuncCursor<'f>fn data_flow_graph(&self) -> &DataFlowGraph[src]
fn data_flow_graph(&self) -> &DataFlowGraphGet an immutable reference to the data flow graph.
fn data_flow_graph_mut(&mut self) -> &mut DataFlowGraph[src]
fn data_flow_graph_mut(&mut self) -> &mut DataFlowGraphGet a mutable reference to the data flow graph.
fn insert_built_inst(self, inst: Inst, _: Type) -> &'c mut DataFlowGraph[src]
fn insert_built_inst(self, inst: Inst, _: Type) -> &'c mut DataFlowGraphInsert a new instruction which belongs to the DFG.
Auto Trait Implementations
impl<'f> Send for FuncCursor<'f>
impl<'f> Send for FuncCursor<'f>impl<'f> Sync for FuncCursor<'f>
impl<'f> Sync for FuncCursor<'f>