Struct cretonne_codegen::cursor::EncCursor [] [src]

pub struct EncCursor<'f> {
    pub func: &'f mut Function,
    pub isa: &'f TargetIsa,
    // some fields omitted
}

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

The referenced function.

The target ISA that will be used to encode instructions.

Methods

impl<'f> EncCursor<'f>
[src]

[src]

Create a new EncCursor pointing nowhere.

[src]

Use the source location of inst for future instructions.

[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.

[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.

[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]

[src]

Get the current cursor position.

[src]

Set the current position.

[src]

Get the source location that should be assigned to new instructions.

[src]

Set the source location that should be assigned to new instructions.

[src]

Borrow a reference to the function layout that this cursor is navigating.

[src]

Borrow a mutable reference to the function layout that this cursor is navigating.

[src]

Exchange this cursor for one with a set source location. Read more

[src]

Rebuild this cursor positioned at pos.

[src]

Rebuild this cursor positioned at inst. Read more

[src]

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

[src]

Rebuild this cursor positioned at the first instruction in ebb. Read more

[src]

Rebuild this cursor positioned at the last instruction in ebb. Read more

[src]

Rebuild this cursor positioned after inst. Read more

[src]

Rebuild this cursor positioned at the top of ebb. Read more

[src]

Rebuild this cursor positioned at the bottom of ebb. Read more

[src]

Get the EBB corresponding to the current position.

[src]

Get the instruction corresponding to the current position, if any.

[src]

Go to the position after a specific instruction, which must be inserted in the layout. New instructions will be inserted after inst. Read more

[src]

Go to a specific instruction which must be inserted in the layout. New instructions will be inserted before inst. Read more

[src]

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

[src]

Go to the first instruction in ebb.

[src]

Go to the last instruction in ebb.

[src]

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

[src]

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

[src]

Go to the top of the next EBB in layout order and return it. Read more

[src]

Go to the bottom of the previous EBB in layout order and return it. Read more

[src]

Move to the next instruction in the same EBB and return it. Read more

[src]

Move to the previous instruction in the same EBB and return it. Read more

[src]

Insert an instruction at the current position. Read more

[src]

Remove the instruction under the cursor. Read more

[src]

Remove the instruction under the cursor. Read more

[src]

Insert an EBB at the current position and switch to it. Read more

impl<'c, 'f> InstInserterBase<'c> for &'c mut EncCursor<'f>
[src]

[src]

Get an immutable reference to the data flow graph.

[src]

Get a mutable reference to the data flow graph.

[src]

Insert a new instruction which belongs to the DFG.

Auto Trait Implementations

impl<'f> !Send for EncCursor<'f>

impl<'f> !Sync for EncCursor<'f>