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]
pub 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.
pub 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.
pub 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.
pub fn load(
instruction_index: u64,
dst: Scalar,
index: Expression
) -> Instruction
[src]
instruction_index: u64,
dst: Scalar,
index: Expression
) -> Instruction
Create a new Load
instruction.
Warning
You almost never want to call this function. You should use the
load
method on il::Block
instead.
pub 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.
pub 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.
pub fn intrinsic(index: u64, intrinsic: Intrinsic) -> Instruction
[src]
Create a new Intrinsic
instruction.
Warning
You almost never want to call this function. You should use the
intrinsic
method on il::Block
instead.
pub fn is_assign(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Assign
pub fn is_store(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Store
pub fn is_load(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Load
pub fn is_branch(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Brc
pub fn is_raise(&self) -> bool
[src]
Returns true
if the Operation
for this Instruction
is Operation::Raise
pub fn operation(&self) -> &Operation
[src]
Get the Operation
for this Instruction
pub fn operation_mut(&mut self) -> &mut Operation
[src]
Get a mutable reference to the Operation
for this Instruction
pub 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.
pub fn comment(&self) -> Option<&str>
[src]
Get the optional comment for this Instruction
pub fn set_comment(&mut self, comment: Option<String>)
[src]
Set the optional comment for this Instruction
pub 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.
pub fn set_address(&mut self, address: Option<u64>)
[src]
Set the optional address for this Instruction
pub fn scalars_written(&self) -> Vec<&Scalar>
[src]
Get the Scalar
which will be written by this Instruction
.
pub fn scalar_written_mut(&mut self) -> Vec<&mut Scalar>
[src]
Get a mutable reference to the Scalar
which will be written by this
Instruction
.
pub fn scalars_read(&self) -> Vec<&Scalar>
[src]
Get a Vec of each Scalar
read by this Instruction
.
pub 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]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
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.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.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