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