[−][src]Struct inkwell::values::FunctionValue
Methods
impl FunctionValue
[src]
pub fn get_linkage(&self) -> Linkage
[src]
pub fn set_linkage(&self, linkage: Linkage)
[src]
pub fn is_null(&self) -> bool
[src]
pub fn is_undef(&self) -> bool
[src]
pub fn print_to_string(&self) -> LLVMString
[src]
pub fn print_to_stderr(&self)
[src]
pub fn verify(&self, print: bool) -> bool
[src]
pub fn get_next_function(&self) -> Option<Self>
[src]
pub fn get_previous_function(&self) -> Option<Self>
[src]
pub fn get_first_param(&self) -> Option<BasicValueEnum>
[src]
pub fn get_last_param(&self) -> Option<BasicValueEnum>
[src]
pub fn get_first_basic_block(&self) -> Option<BasicBlock>
[src]
pub fn append_basic_block(&self, name: &str) -> BasicBlock
[src]
pub fn get_nth_param(&self, nth: u32) -> Option<BasicValueEnum>
[src]
pub fn count_params(&self) -> u32
[src]
pub fn count_basic_blocks(&self) -> u32
[src]
pub fn get_basic_blocks(&self) -> Vec<BasicBlock>
[src]
pub fn get_param_iter(&self) -> ParamValueIter
[src]
pub fn get_params(&self) -> Vec<BasicValueEnum>
[src]
pub fn get_last_basic_block(&self) -> Option<BasicBlock>
[src]
pub fn get_name(&self) -> &CStr
[src]
pub fn view_function_config(&self)
[src]
pub fn view_function_config_only(&self)
[src]
pub unsafe fn delete(self)
[src]
pub fn get_type(&self) -> FunctionType
[src]
pub fn has_metadata(&self) -> bool
[src]
pub fn get_metadata(&self, kind_id: u32) -> Option<MetadataValue>
[src]
pub fn set_metadata(&self, metadata: MetadataValue, kind_id: u32)
[src]
pub fn has_personality_function(&self) -> bool
[src]
pub fn get_personality_function(&self) -> Option<FunctionValue>
[src]
pub fn set_personality_function(&self, personality_fn: FunctionValue)
[src]
pub fn get_intrinsic_id(&self) -> u32
[src]
pub fn get_call_conventions(&self) -> u32
[src]
pub fn set_call_conventions(&self, call_conventions: u32)
[src]
pub fn get_gc(&self) -> &CStr
[src]
pub fn set_gc(&self, gc: &str)
[src]
pub fn replace_all_uses_with(&self, other: FunctionValue)
[src]
pub fn add_attribute(&self, loc: AttributeLoc, attribute: Attribute)
[src]
Adds an Attribute
to a particular location in this FunctionValue
.
Example
use inkwell::attributes::AttributeLoc; use inkwell::context::Context; let context = Context::create(); let module = context.create_module("my_mod"); let void_type = context.void_type(); let fn_type = void_type.fn_type(&[], false); let fn_value = module.add_function("my_fn", fn_type, None); let string_attribute = context.create_string_attribute("my_key", "my_val"); let enum_attribute = context.create_enum_attribute(1, 1); fn_value.add_attribute(AttributeLoc::Return, string_attribute); fn_value.add_attribute(AttributeLoc::Return, enum_attribute);
pub fn count_attributes(&self, loc: AttributeLoc) -> u32
[src]
Counts the number of Attribute
s belonging to the specified location in this FunctionValue
.
Example
use inkwell::attributes::AttributeLoc; use inkwell::context::Context; let context = Context::create(); let module = context.create_module("my_mod"); let void_type = context.void_type(); let fn_type = void_type.fn_type(&[], false); let fn_value = module.add_function("my_fn", fn_type, None); let string_attribute = context.create_string_attribute("my_key", "my_val"); let enum_attribute = context.create_enum_attribute(1, 1); fn_value.add_attribute(AttributeLoc::Return, string_attribute); fn_value.add_attribute(AttributeLoc::Return, enum_attribute); assert_eq!(fn_value.count_attributes(AttributeLoc::Return), 2);
pub fn remove_string_attribute(&self, loc: AttributeLoc, key: &str)
[src]
Removes a string Attribute
belonging to the specified location in this FunctionValue
.
Example
use inkwell::attributes::AttributeLoc; use inkwell::context::Context; let context = Context::create(); let module = context.create_module("my_mod"); let void_type = context.void_type(); let fn_type = void_type.fn_type(&[], false); let fn_value = module.add_function("my_fn", fn_type, None); let string_attribute = context.create_string_attribute("my_key", "my_val"); fn_value.add_attribute(AttributeLoc::Return, string_attribute); fn_value.remove_string_attribute(AttributeLoc::Return, "my_key");
pub fn remove_enum_attribute(&self, loc: AttributeLoc, kind_id: u32)
[src]
Removes an enum Attribute
belonging to the specified location in this FunctionValue
.
Example
use inkwell::attributes::AttributeLoc; use inkwell::context::Context; let context = Context::create(); let module = context.create_module("my_mod"); let void_type = context.void_type(); let fn_type = void_type.fn_type(&[], false); let fn_value = module.add_function("my_fn", fn_type, None); let enum_attribute = context.create_enum_attribute(1, 1); fn_value.add_attribute(AttributeLoc::Return, enum_attribute); fn_value.remove_enum_attribute(AttributeLoc::Return, 1);
pub fn get_enum_attribute(
&self,
loc: AttributeLoc,
kind_id: u32
) -> Option<Attribute>
[src]
&self,
loc: AttributeLoc,
kind_id: u32
) -> Option<Attribute>
Gets an enum Attribute
belonging to the specified location in this FunctionValue
.
Example
use inkwell::attributes::AttributeLoc; use inkwell::context::Context; let context = Context::create(); let module = context.create_module("my_mod"); let void_type = context.void_type(); let fn_type = void_type.fn_type(&[], false); let fn_value = module.add_function("my_fn", fn_type, None); let enum_attribute = context.create_enum_attribute(1, 1); fn_value.add_attribute(AttributeLoc::Return, enum_attribute); assert_eq!(fn_value.get_enum_attribute(AttributeLoc::Return, 1), Some(enum_attribute));
pub fn get_string_attribute(
&self,
loc: AttributeLoc,
key: &str
) -> Option<Attribute>
[src]
&self,
loc: AttributeLoc,
key: &str
) -> Option<Attribute>
Gets a string Attribute
belonging to the specified location in this FunctionValue
.
Example
use inkwell::attributes::AttributeLoc; use inkwell::context::Context; let context = Context::create(); let module = context.create_module("my_mod"); let void_type = context.void_type(); let fn_type = void_type.fn_type(&[], false); let fn_value = module.add_function("my_fn", fn_type, None); let string_attribute = context.create_string_attribute("my_key", "my_val"); fn_value.add_attribute(AttributeLoc::Return, string_attribute); assert_eq!(fn_value.get_string_attribute(AttributeLoc::Return, "my_key"), Some(string_attribute));
pub fn set_param_alignment(&self, param_index: u32, alignment: u32)
[src]
pub fn as_global_value(&self) -> GlobalValue
[src]
Gets the GlobalValue
version of this FunctionValue
. This allows
you to further inspect its global properties or even convert it to
a PointerValue
.
Trait Implementations
impl PassManagerSubType for FunctionValue
[src]
type Input = Module
unsafe fn create<I: Borrow<Self::Input>>(input: I) -> LLVMPassManagerRef
[src]
unsafe fn run_in_pass_manager(&self, pass_manager: &PassManager<Self>) -> bool
[src]
impl AnyValue for FunctionValue
[src]
fn as_any_value_enum(&self) -> AnyValueEnum
[src]
impl Eq for FunctionValue
[src]
impl Into<Either<FunctionValue, PointerValue>> for FunctionValue
[src]
fn into(self) -> Either<FunctionValue, PointerValue>
[src]
impl Clone for FunctionValue
[src]
fn clone(&self) -> FunctionValue
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialEq<FunctionValue> for AnyValueEnum
[src]
fn eq(&self, other: &FunctionValue) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<AnyValueEnum> for FunctionValue
[src]
fn eq(&self, other: &AnyValueEnum) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<FunctionValue> for FunctionValue
[src]
fn eq(&self, other: &FunctionValue) -> bool
[src]
fn ne(&self, other: &FunctionValue) -> bool
[src]
impl From<FunctionValue> for AnyValueEnum
[src]
fn from(value: FunctionValue) -> AnyValueEnum
[src]
impl Copy for FunctionValue
[src]
impl Hash for FunctionValue
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Debug for FunctionValue
[src]
Auto Trait Implementations
impl !Sync for FunctionValue
impl !Send for FunctionValue
impl Unpin for FunctionValue
impl UnwindSafe for FunctionValue
impl RefUnwindSafe for FunctionValue
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,