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 FunctionThe referenced function.
Implementations
impl<'f> FuncCursor<'f>[src]
impl<'f> FuncCursor<'f>[src]pub fn new(func: &'f mut Function) -> Self[src]
Create a new FuncCursor pointing nowhere.
pub fn use_srcloc(&mut self, inst: Inst)[src]
Use the source location of inst for future instructions.
pub fn ins(&mut self) -> InsertBuilder<'_, &mut FuncCursor<'f>>[src]
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>[src]fn position(&self) -> CursorPosition[src]
fn set_position(&mut self, pos: CursorPosition)[src]
fn srcloc(&self) -> SourceLoc[src]
fn set_srcloc(&mut self, srcloc: SourceLoc)[src]
fn layout(&self) -> &Layout[src]
fn layout_mut(&mut self) -> &mut Layout[src]
fn with_srcloc(self, srcloc: SourceLoc) -> Self where
Self: Sized, [src]
Self: Sized,
fn at_position(self, pos: CursorPosition) -> Self where
Self: Sized, [src]
Self: Sized,
fn at_inst(self, inst: Inst) -> Self where
Self: Sized, [src]
Self: Sized,
fn at_first_insertion_point(self, block: Block) -> Self where
Self: Sized, [src]
Self: Sized,
fn at_first_inst(self, block: Block) -> Self where
Self: Sized, [src]
Self: Sized,
fn at_last_inst(self, block: Block) -> Self where
Self: Sized, [src]
Self: Sized,
fn after_inst(self, inst: Inst) -> Self where
Self: Sized, [src]
Self: Sized,
fn at_top(self, block: Block) -> Self where
Self: Sized, [src]
Self: Sized,
fn at_bottom(self, block: Block) -> Self where
Self: Sized, [src]
Self: Sized,
fn current_block(&self) -> Option<Block>[src]
fn current_inst(&self) -> Option<Inst>[src]
fn goto_after_inst(&mut self, inst: Inst)[src]
fn goto_inst(&mut self, inst: Inst)[src]
fn goto_first_insertion_point(&mut self, block: Block)[src]
fn goto_first_inst(&mut self, block: Block)[src]
fn goto_last_inst(&mut self, block: Block)[src]
fn goto_top(&mut self, block: Block)[src]
fn goto_bottom(&mut self, block: Block)[src]
fn next_block(&mut self) -> Option<Block>[src]
fn prev_block(&mut self) -> Option<Block>[src]
fn next_inst(&mut self) -> Option<Inst>[src]
fn prev_inst(&mut self) -> Option<Inst>[src]
fn insert_inst(&mut self, inst: Inst)[src]
fn remove_inst(&mut self) -> Inst[src]
fn remove_inst_and_step_back(&mut self) -> Inst[src]
fn insert_block(&mut self, new_block: Block)[src]
impl<'c, 'f> InstInserterBase<'c> for &'c mut FuncCursor<'f>[src]
impl<'c, 'f> InstInserterBase<'c> for &'c mut FuncCursor<'f>[src]