Struct llvm::Function [] [src]

pub struct Function;

A function is a kind of value that can be called and contains blocks of code.

To get the value of each argument to a function, you can use the index operator. For example, &func[0] is the value that represents the first argument to the function.

Methods

impl Function
[src]

fn append<'a>(&'a self, name: &str) -> &'a BasicBlock

Add a basic block with the name given to the function and return it.

fn get_entry(&self) -> Option<&BasicBlock>

Returns the entry block of this function or None if there is none.

fn get_name(&self) -> &str

Returns the name of this function.

fn get_signature(&self) -> &FunctionType

Returns the function signature representing this function's signature.

fn add_attribute(&self, attr: Attribute)

Add the attribute given to this function.

fn add_attributes(&self, attrs: &[Attribute])

Add all the attributes given to this function.

fn has_attribute(&self, attr: Attribute) -> bool

Returns true if the attribute given is set in this function.

fn has_attributes(&self, attrs: &[Attribute]) -> bool

Returns true if all the attributes given is set in this function.

fn remove_attribute(&self, attr: Attribute)

Remove the attribute given from this function.

Methods from Deref<Target=GlobalValue>

fn set_linkage(&self, linkage: Linkage)

Set the linkage type for this global

fn get_linkage(&self) -> Linkage

Returns the linkage type for this global

fn is_declaration(&self) -> bool

Returns true if this global is a declaration (as opposed to a definition).

Trait Implementations

impl Eq for Function
[src]

impl PartialEq<Function> for Function
[src]

fn eq(&self, other: &Function) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl<'a> PartialEq<Function> for &'a Function
[src]

fn eq(&self, other: &Function) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl<'a> From<LLVMValueRef> for &'a Function
[src]

fn from(ty: LLVMValueRef) -> &'a Function

Performs the conversion.

impl<'a> From<LLVMValueRef> for &'a mut Function
[src]

fn from(ty: LLVMValueRef) -> &'a mut Function

Performs the conversion.

impl Sub<GlobalValue> for Function
[src]

fn is(value: &GlobalValue) -> bool

Check if the given super value is an instance of this type.

fn from_super(value: &GlobalValue) -> Option<&Function>

Attempt to cast the given super value into an instance of this type.

fn to_super(&self) -> &T

Cast this value to a super value.

impl Deref for Function
[src]

type Target = GlobalValue

The resulting type after dereferencing

fn deref(&self) -> &GlobalValue

The method called to dereference a value

impl Index<usize> for Function
[src]

type Output = Arg

The returned type after indexing

fn index(&self, index: usize) -> &Arg

The method for the indexing (Foo[Bar]) operation

impl Sub<Value> for Function
[src]

fn is(value: &Value) -> bool

Check if the given super value is an instance of this type.

fn from_super(c: &T) -> Option<&Self>

Attempt to cast the given super value into an instance of this type.

fn to_super(&self) -> &T

Cast this value to a super value.

impl GetContext for Function
[src]

fn get_context(&self) -> &Context

Returns a reference to the context that owns this value. Read more