[][src]Struct inkwell::values::FunctionValue

pub struct FunctionValue { /* fields omitted */ }

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 Attributes 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]

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]

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

impl AnyValue for FunctionValue[src]

impl Eq for FunctionValue[src]

impl Into<Either<FunctionValue, PointerValue>> for FunctionValue[src]

impl Clone for FunctionValue[src]

impl PartialEq<FunctionValue> for AnyValueEnum[src]

impl PartialEq<AnyValueEnum> for FunctionValue[src]

impl PartialEq<FunctionValue> for FunctionValue[src]

impl From<FunctionValue> for AnyValueEnum[src]

impl Copy for FunctionValue[src]

impl Hash for FunctionValue[src]

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]

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

type Owned = T

The resulting type after obtaining ownership.

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

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.

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

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

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