pub struct Function(_);Expand description
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.
Implementations§
source§impl Function
impl Function
sourcepub fn append<'a>(&'a self, name: &str) -> &'a BasicBlock
pub fn append<'a>(&'a self, name: &str) -> &'a BasicBlock
Add a basic block with the name given to the function and return it.
sourcepub fn get_entry(&self) -> Option<&BasicBlock>
pub fn get_entry(&self) -> Option<&BasicBlock>
Returns the entry block of this function or None if there is none.
sourcepub fn get_signature(&self) -> &FunctionType
pub fn get_signature(&self) -> &FunctionType
Returns the function signature representing this function’s signature.
Methods from Deref<Target = GlobalValue>§
sourcepub fn set_linkage(&self, linkage: Linkage)
pub fn set_linkage(&self, linkage: Linkage)
Set the linkage type for this global
sourcepub fn get_linkage(&self) -> Linkage
pub fn get_linkage(&self) -> Linkage
Returns the linkage type for this global
sourcepub fn is_declaration(&self) -> bool
pub fn is_declaration(&self) -> bool
Returns true if this global is a declaration (as opposed to a definition).
Methods from Deref<Target = Value>§
Trait Implementations§
source§impl Deref for Function
impl Deref for Function
§type Target = GlobalValue
type Target = GlobalValue
The resulting type after dereferencing.
source§fn deref(&self) -> &GlobalValue
fn deref(&self) -> &GlobalValue
Dereferences the value.
source§impl<'a> From<&'a Function> for LLVMValueRef
impl<'a> From<&'a Function> for LLVMValueRef
source§fn from(ty: &'a Function) -> LLVMValueRef
fn from(ty: &'a Function) -> LLVMValueRef
Converts to this type from the input type.
source§impl<'a> From<&'a mut Function> for LLVMValueRef
impl<'a> From<&'a mut Function> for LLVMValueRef
source§fn from(ty: &'a mut Function) -> LLVMValueRef
fn from(ty: &'a mut Function) -> LLVMValueRef
Converts to this type from the input type.
source§impl<'a> From<*mut LLVMValue> for &'a Function
impl<'a> From<*mut LLVMValue> for &'a Function
source§fn from(ty: LLVMValueRef) -> &'a Function
fn from(ty: LLVMValueRef) -> &'a Function
Converts to this type from the input type.
source§impl<'a> From<*mut LLVMValue> for &'a mut Function
impl<'a> From<*mut LLVMValue> for &'a mut Function
source§fn from(ty: LLVMValueRef) -> &'a mut Function
fn from(ty: LLVMValueRef) -> &'a mut Function
Converts to this type from the input type.
source§impl GetContext for Function
impl GetContext for Function
source§fn get_context(&self) -> &Context
fn get_context(&self) -> &Context
Returns a reference to the context that owns this value. Read more
source§impl<'a> IntoIterator for &'a Function
impl<'a> IntoIterator for &'a Function
source§impl Sub<GlobalValue> for Function
impl Sub<GlobalValue> for Function
source§fn is(value: &GlobalValue) -> bool
fn is(value: &GlobalValue) -> bool
Check if the given super value is an instance of this type.
source§fn from_super(value: &GlobalValue) -> Option<&Function>
fn from_super(value: &GlobalValue) -> Option<&Function>
Attempt to cast the given super value into an instance of this type.