Struct falcon::il::Instruction [] [src]

pub struct Instruction { /* fields omitted */ }

An Instruction represents location, and non-semantical information about an Operation.

An instruction gives location to an Operation.

Methods are provided to create individual instructions, as all uses cases cannot be seen beforehand. However, it is generally poor-form to create an Instruction manually. You should use the methods on Block which correspond to the Operation you wish to create, and the Instruction will be created automatically.

Methods

impl Instruction
[src]

[src]

Create a new instruction with the given index and operation.

Warning

You almost never want to call this function. You should use the methods on il::Block which correspond to the operation you wish to append to that block.

[src]

Create a new Assign instruction.

Warning

You almost never want to call this function. You should use the assign method on il::Block instead.

[src]

Create a new Store instruction.

Warning

You almost never want to call this function. You should use the store method on il::Block instead.

[src]

Create a new Load instruction.

Warning

You almost never want to call this function. You should use the load method on il::Block instead.

[src]

Create a new Brc instruction.

Warning

You almost never want to call this function. You should use the brc method on il::Block instead.

[src]

Create a new Raise instruction.

Warning

You almost never want to call this function. You should use the raise method on il::Block instead.

[src]

Returns true if the Operation for this Instruction is Operation::Assign

[src]

Returns true if the Operation for this Instruction is Operation::Store

[src]

Returns true if the Operation for this Instruction is Operation::Load

[src]

Returns true if the Operation for this Instruction is Operation::Brc

[src]

Returns true if the Operation for this Instruction is Operation::Raise

[src]

Get the Operation for this Instruction

[src]

Get a mutable reference to the Operation for this Instruction

[src]

Get the index for this Instruction.

An Instruction index is assigned by its parent Block and uniquely identifies the Instruction within the Block. Instruction indices need not be continuous, nor in order.

[src]

Get the optional comment for this Instruction

[src]

Set the optional comment for this Instruction

[src]

Get the optional address for this Instruction

An Instruction will typically have an address if one was given by a translator. It is not uncommon for there to be a mixture of Instructions with and without comments. For example, applying SSA to a Function will cause Phi instructions to be inserted, and these instructions will not have addresses.

[src]

Set the optional address for this Instruction

[src]

Get the Variable which will be written by this Instruction.

This is a convenience function around Operation::variable_written.

[src]

Get a mutable reference to the Variable which will be written by this Instruction.

This is a convenience function around Operation::variable_written_mut.

[src]

Get a Vec of each Variable read by this Instruction.

This is a convenience function around Operation::variables_read.

[src]

Get a Vec of mutable references for each Variable read by this Instruction.

This is a convenience function around Operation::variables_read_mut.

Trait Implementations

impl Clone for Instruction
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Instruction
[src]

[src]

Formats the value using the given formatter.

impl Eq for Instruction
[src]

impl Hash for Instruction
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Ord for Instruction
[src]

[src]

This method returns an Ordering between self and other. Read more

1.22.0
[src]

Compares and returns the maximum of two values. Read more

1.22.0
[src]

Compares and returns the minimum of two values. Read more

impl PartialEq for Instruction
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl PartialOrd for Instruction
[src]

[src]

This method returns an ordering between self and other values if one exists. Read more

[src]

This method tests less than (for self and other) and is used by the < operator. Read more

[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Display for Instruction
[src]

[src]

Formats the value using the given formatter. Read more