[][src]Struct llir::values::Function

pub struct Function<'ctx>(_, _);

Implementations

impl<'ctx> Function<'ctx>[src]

pub fn name(&self) -> String[src]

Get the name of the function

pub fn is_declaration_only(&self) -> bool[src]

Check if this function is declaration only

pub fn iter_blocks(&self) -> FunctionBlockIterator<'ctx>[src]

Iterate blocks inside of this function

for blk in func.iter_blocks() {
  // Do things to blk...
}

pub fn iter_instructions(&self) -> FunctionInstructionIterator<'ctx>[src]

Iterate all the instructions of this function; will iterate the blocks and then the instructions in each block

for instr in func.iter_instructions() {
  // Do things with instr...
}

is exactly the same as

for blk in func.iter_blocks() {
  for instr in blk.iter_instructions() {
    // Do things with instr...
  }
}

pub fn num_blocks(&self) -> usize[src]

Get the number of blocks inside the function

pub fn first_block(&self) -> Option<Block<'ctx>>[src]

Get the first block of this function

pub fn last_block(&self) -> Option<Block<'ctx>>[src]

Get the last block of this function

pub fn is_var_arg(&self) -> bool[src]

Check if the function is variable arguments

pub fn num_arguments(&self) -> usize[src]

Get the number of arguments in this function

pub fn arguments(&self) -> Vec<Argument<'ctx>>[src]

Get the arguments to this function in vector form

pub fn argument(&self, index: usize) -> Argument<'ctx>[src]

Get the argument at a given index

pub fn get_function_type(&self) -> FunctionType<'ctx>[src]

Get the function type

Trait Implementations

impl<'ctx> AsConstant<'ctx> for Function<'ctx>[src]

impl<'ctx> AsOperand<'ctx> for Function<'ctx>[src]

impl<'ctx> Clone for Function<'ctx>[src]

impl<'ctx> Copy for Function<'ctx>[src]

impl<'ctx> Debug for Function<'ctx>[src]

impl<'ctx> Eq for Function<'ctx>[src]

impl<'ctx> GetDebugLoc for Function<'ctx>[src]

impl<'ctx> GetDebugMetadata<'ctx> for Function<'ctx>[src]

impl<'ctx> GetType<'ctx> for Function<'ctx>[src]

impl<'ctx> Hash for Function<'ctx>[src]

impl<'ctx> PartialEq<Function<'ctx>> for Function<'ctx>[src]

impl<'ctx> Send for Function<'ctx>[src]

impl<'ctx> StructuralEq for Function<'ctx>[src]

impl<'ctx> StructuralPartialEq for Function<'ctx>[src]

impl<'ctx> Sync for Function<'ctx>[src]

Auto Trait Implementations

impl<'ctx> RefUnwindSafe for Function<'ctx>

impl<'ctx> Unpin for Function<'ctx>

impl<'ctx> UnwindSafe for Function<'ctx>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.