pub struct Function(pub Index);
Tuple Fields
0: Index
Implementations
Create and append a new Block
to this function.
Create and insert a new Block
into this function.
The new block is inserted before other
.
Create and insert a new Block
into this function.
The new block is inserted after other
.
Get a new unique block label.
If hint
is None
then the label will be in the form "blockN"
where N is an
incrementing decimal.
Otherwise if the hint is already unique to this function it will be returned. If not already unique it will have N appended to it until it is unique.
Return the function entry (i.e., the first) block.
Whether this function has a valid selector.
Return the function selector, if it has one.
Get an arg value by name, if found.
Find the name of an arg by value.
Return an iterator for each of the function arguments.
Get a pointer to a local value by name, if found.
Find the name of a local value by pointer.
Add a value to the function local storage.
The name must be unique to this function else an error is returned.
Add a value to the function local storage, by forcing the name to be unique if needed.
Will use the provided name as a hint and rename to guarantee insertion.
Return an iterator to all of the values in this function’s local storage.
Merge values from another Function
into this one.
The names of the merged values are guaranteed to be unique via the use of
Function::new_unique_local_ptr
.
Returns a map from the original pointers to the newly merged pointers.
XXX This function returns a Result but can’t actually fail?
pub fn block_iter(&self, context: &Context) -> BlockIteratorⓘNotable traits for BlockIteratorimpl Iterator for BlockIterator type Item = Block;
pub fn block_iter(&self, context: &Context) -> BlockIteratorⓘNotable traits for BlockIteratorimpl Iterator for BlockIterator type Item = Block;
impl Iterator for BlockIterator type Item = Block;
Return an iterator to each block in this function.
Return an iterator to each instruction in each block in this function.
This is a convenience method for when all instructions in a function need to be inspected. The instruction value is returned from the iterator along with the block it belongs to.
Replace a value with another within this function.
This is a convenience method which iterates over this function’s blocks and calls
Block::replace_value
in turn.
starting_block
is an optimisation for when the first possible reference to old_val
is
known.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Function
impl UnwindSafe for Function
Blanket Implementations
Mutably borrows from an owned value. Read more