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]
fn new(index: u64, operation: Operation) -> Instruction
[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.
fn assign(index: u64, dst: Scalar, src: Expression) -> Instruction
[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.
fn store(
instruction_index: u64,
index: Expression,
src: Expression
) -> Instruction
[src]
instruction_index: u64,
index: Expression,
src: Expression
) -> Instruction
Create a new Store
instruction.
Warning
You almost never want to call this function. You should use the
store
method on il::Block
instead.
fn load(instruction_index: u64, dst: Scalar, index: Expression) -> Instruction
[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.
fn branch(index: u64, target: Expression) -> Instruction
[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.
fn raise(index: u64, expr: Expression) -> Instruction
[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.
fn is_assign(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Assign
fn is_store(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Store
fn is_load(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Load
fn is_branch(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Brc
fn is_raise(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Raise
fn operation(&self) -> &Operation
[src]
Get the Operation
for this Instruction
fn operation_mut(&mut self) -> &mut Operation
[src]
Get a mutable reference to the Operation
for this Instruction
fn index(&self) -> u64
[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.
fn comment(&self) -> &Option<String>
[src]
Get the optional comment for this Instruction
fn set_comment(&mut self, comment: Option<String>)
[src]
Set the optional comment for this Instruction
fn address(&self) -> Option<u64>
[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 Instruction
s 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.
fn set_address(&mut self, address: Option<u64>)
[src]
Set the optional address for this Instruction
fn scalar_written(&self) -> Option<&Scalar>
[src]
Get the Scalar
which will be written by this Instruction
.
fn scalar_written_mut(&mut self) -> Option<&mut Scalar>
[src]
Get a mutable reference to the Scalar
which will be written by this
Instruction
.
fn scalars_read(&self) -> Vec<&Scalar>
[src]
Get a Vec of each Scalar
read by this Instruction
.
fn scalars_read_mut(&mut self) -> Vec<&mut Scalar>
[src]
Get a Vec of mutable references for each Scalar
read by this
Instruction
.
Trait Implementations
impl Clone for Instruction
[src]
fn clone(&self) -> Instruction
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Instruction
[src]
impl Eq for Instruction
[src]
impl Hash for Instruction
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Ord for Instruction
[src]
fn cmp(&self, __arg_0: &Instruction) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl PartialEq for Instruction
[src]
fn eq(&self, __arg_0: &Instruction) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Instruction) -> bool
[src]
This method tests for !=
.
impl PartialOrd for Instruction
[src]
fn partial_cmp(&self, __arg_0: &Instruction) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Instruction) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Instruction) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Instruction) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Instruction) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more