Struct llvm_ir::function::Function

source ·
pub struct Function {
Show 17 fields pub name: String, pub parameters: Vec<Parameter>, pub is_var_arg: bool, pub return_type: TypeRef, pub basic_blocks: Vec<BasicBlock>, pub function_attributes: Vec<FunctionAttribute>, pub return_attributes: Vec<ParameterAttribute>, pub linkage: Linkage, pub visibility: Visibility, pub dll_storage_class: DLLStorageClass, pub calling_convention: CallingConvention, pub section: Option<String>, pub comdat: Option<Comdat>, pub alignment: u32, pub garbage_collector_name: Option<String>, pub personality_function: Option<ConstantRef>, pub debugloc: Option<DebugLoc>,
}
Expand description

Fields§

§name: String§parameters: Vec<Parameter>§is_var_arg: bool§return_type: TypeRef§basic_blocks: Vec<BasicBlock>§function_attributes: Vec<FunctionAttribute>§return_attributes: Vec<ParameterAttribute>§linkage: Linkage§visibility: Visibility§dll_storage_class: DLLStorageClass§calling_convention: CallingConvention§section: Option<String>§comdat: Option<Comdat>§alignment: u32§garbage_collector_name: Option<String>§personality_function: Option<ConstantRef>

Personalities are used for exception handling. See LLVM 14 docs on Personality Function

§debugloc: Option<DebugLoc>

Implementations§

source§

impl Function

source

pub fn get_bb_by_name(&self, name: &Name) -> Option<&BasicBlock>

Get the BasicBlock having the given Name (if any).

source

pub fn new(name: impl Into<String>) -> Self

A Function instance as empty as possible, using defaults

Trait Implementations§

source§

impl Clone for Function

source§

fn clone(&self) -> Function

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Function

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl HasDebugLoc for Function

source§

fn get_debug_loc(&self) -> &Option<DebugLoc>

Returns the DebugLoc associated with the given Instruction, Terminator, GlobalVariable, or Function; or None if it doesn’t have a DebugLoc. Read more
source§

impl PartialEq for Function

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Typed for Function

source§

fn get_type(&self, types: &Types) -> TypeRef

source§

impl StructuralPartialEq for Function

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.