[−][src]Struct cranelift_codegen::cursor::EncCursor
Encoding cursor.
An EncCursor
can be used to insert instructions that are immediately assigned an encoding.
The cursor holds a mutable reference to the whole function which can be re-borrowed from the
public pos.func
member.
Fields
func: &'f mut Function
The referenced function.
isa: &'f dyn TargetIsa
The target ISA that will be used to encode instructions.
Methods
impl<'f> EncCursor<'f>
[src]
pub fn new(func: &'f mut Function, isa: &'f dyn TargetIsa) -> Self
[src]
Create a new EncCursor
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 EncCursor<'f>>
[src]
Create an instruction builder that will insert an encoded instruction at the current position.
The builder will panic if it is used to insert an instruction that can't be encoded for
self.isa
.
pub fn built_inst(&self) -> Inst
[src]
Get the last built instruction.
This returns the last instruction that was built using the ins()
method on this cursor.
Panics if no instruction was built.
pub fn display_inst(&self, inst: Inst) -> DisplayInst
[src]
Return an object that can display inst
.
This is a convenience wrapper for the DFG equivalent.
Trait Implementations
impl<'f> Cursor for EncCursor<'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, ebb: Ebb) -> Self where
Self: Sized,
[src]
Self: Sized,
fn at_first_inst(self, ebb: Ebb) -> Self where
Self: Sized,
[src]
Self: Sized,
fn at_last_inst(self, ebb: Ebb) -> Self where
Self: Sized,
[src]
Self: Sized,
fn after_inst(self, inst: Inst) -> Self where
Self: Sized,
[src]
Self: Sized,
fn at_top(self, ebb: Ebb) -> Self where
Self: Sized,
[src]
Self: Sized,
fn at_bottom(self, ebb: Ebb) -> Self where
Self: Sized,
[src]
Self: Sized,
fn current_ebb(&self) -> Option<Ebb>
[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, ebb: Ebb)
[src]
fn goto_first_inst(&mut self, ebb: Ebb)
[src]
fn goto_last_inst(&mut self, ebb: Ebb)
[src]
fn goto_top(&mut self, ebb: Ebb)
[src]
fn goto_bottom(&mut self, ebb: Ebb)
[src]
fn next_ebb(&mut self) -> Option<Ebb>
[src]
fn prev_ebb(&mut self) -> Option<Ebb>
[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_ebb(&mut self, new_ebb: Ebb)
[src]
impl<'c, 'f> InstInserterBase<'c> for &'c mut EncCursor<'f>
[src]
fn data_flow_graph(&self) -> &DataFlowGraph
[src]
fn data_flow_graph_mut(&mut self) -> &mut DataFlowGraph
[src]
fn insert_built_inst(
self,
inst: Inst,
ctrl_typevar: Type
) -> &'c mut DataFlowGraph
[src]
self,
inst: Inst,
ctrl_typevar: Type
) -> &'c mut DataFlowGraph
Auto Trait Implementations
impl<'f> Send for EncCursor<'f>
impl<'f> Sync for EncCursor<'f>
impl<'f> Unpin for EncCursor<'f>
impl<'f> !RefUnwindSafe for EncCursor<'f>
impl<'f> !UnwindSafe for EncCursor<'f>
Blanket Implementations
impl<T> From<T> for T
[src]
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> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,