Struct inkwell::values::FunctionValue [−][src]
pub struct FunctionValue<'ctx> { /* fields omitted */ }
Implementations
View the control flow graph and produce a .dot file
Only view the control flow graph
llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.llvm3-7
or llvm3-8
or llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.This is supported on crate features llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.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);
This is supported on crate features llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.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);
This is supported on crate features llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.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");
This is supported on crate features llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.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);
This is supported on crate features llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.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));
This is supported on crate features llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
llvm3-9
or llvm4-0
or llvm5-0
or llvm6-0
or llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.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));
Gets the GlobalValue
version of this FunctionValue
. This allows
you to further inspect its global properties or even convert it to
a PointerValue
.
This is supported on crate features llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.Set the debug info descriptor
This is supported on crate features llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.
llvm7-0
or llvm8-0
or llvm9-0
or llvm10-0
or llvm11-0
or llvm12-0
only.Get the debug info descriptor
Trait Implementations
Returns an enum containing a typed version of AnyValue
.
Prints a value to a LLVMString
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<'ctx> RefUnwindSafe for FunctionValue<'ctx>
impl<'ctx> !Send for FunctionValue<'ctx>
impl<'ctx> !Sync for FunctionValue<'ctx>
impl<'ctx> Unpin for FunctionValue<'ctx>
impl<'ctx> UnwindSafe for FunctionValue<'ctx>
Blanket Implementations
Mutably borrows from an owned value. Read more