Struct IRBuilder

Source
pub struct IRBuilder { /* private fields */ }

Implementations§

Source§

impl IRBuilder

Source

pub fn get_llvm_builder(&self) -> LLVMBuilderRef

Source

pub fn build_return_void(&self)

Source

pub fn build_return(&self, value: LLVMValue)

Source

pub fn build_global_string_ptr( &self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> LLVMValue

Source

pub fn build_global_string( &self, name: impl AsRef<str>, value: impl AsRef<str>, ) -> LLVMValue

Source

pub fn build_alloca(&self, name: impl AsRef<str>, ty: &LLVMType) -> LLVMValue

Source

pub fn build_array(&self, el_ty: LLVMType, arr: Vec<LLVMValue>) -> LLVMValue

Source

pub fn build_struct_get(&self, val: &StructValue, idx: usize) -> LLVMValue

Source

pub fn build_struct_insert( &self, val: LLVMValue, idx: usize, value: &LLVMValue, ) -> LLVMValue

Source

pub fn build_i64_to_ptr(&self, val: LLVMValue) -> LLVMValue

Source

pub fn build_struct_gep( &self, ty: &LLVMType, val: LLVMValue, idx: usize, ) -> LLVMValue

Source

pub fn build_unreachable(&self)

Source

pub fn build_store(&self, ptr: LLVMValueRef, val: LLVMValue)

Source

pub fn build_load(&self, ty: LLVMType, ptr: LLVMValueRef) -> LLVMValue

Source

pub fn build_array_get( &self, ty: LLVMType, ptr: LLVMValue, index: LLVMValue, ) -> LLVMValue

Source

pub fn build_array_get_in_bounds( &self, ty: LLVMType, ptr: LLVMValue, index: LLVMValue, ) -> LLVMValue

Source

pub fn build_array_gep( &self, ty: LLVMType, ptr: LLVMValue, index: LLVMValue, ) -> LLVMValue

Source

pub fn position_at_end(&self, block: LLVMBasicBlockRef)

Source

pub fn build_br(&self, block: LLVMBasicBlockRef)

Source

pub fn build_cond_br( &self, condition: &BoolValue, then_block: LLVMBasicBlockRef, else_block: LLVMBasicBlockRef, )

Source

pub fn build_add(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fadd(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fmul(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_mul(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_sub(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_div(&self, l: LLVMValueRef, r: LLVMValueRef) -> LLVMValue

Source

pub fn build_fsub(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fdiv(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_si_to_fp(&self, val: LLVMValue, dest_ty: LLVMType) -> LLVMValue

Source

pub fn build_fp_to_si(&self, val: LLVMValue, dest_ty: LLVMType) -> LLVMValue

Source

pub fn build_eq(&self, l: LLVMValueRef, r: LLVMValueRef) -> BoolValue

Source

pub fn build_neq(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_greater(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_less(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_call( &self, ctx: &Context, function: &FunctionValue, params: &mut [LLVMValue], var_name: impl AsRef<str>, ) -> LLVMValue

Source

pub fn build_call_fn_ptr( &self, fn_type: LLVMType, ptr: LLVMValue, params: &mut [LLVMValue], var_name: impl AsRef<str>, ) -> LLVMValue

Source

pub fn build_zext(&self, value: LLVMValue, ty: LLVMType) -> LLVMValue

Source

pub fn build_extract_value( &self, ctx: &Context, val: &StructValue, idx: usize, ) -> LLVMValue

Source

pub fn build_less_equal(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_greater_equal(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_and(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_or(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fneg(&self, val: LLVMValue) -> LLVMValue

Source

pub fn build_neg(&self, val: LLVMValue) -> LLVMValue

Source

pub fn build_fcmp( &self, pred: LLVMRealPredicate, l: LLVMValue, r: LLVMValue, ) -> LLVMValue

Source

pub fn build_fcmp_oeq(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fcmp_one(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fcmp_ogt(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fcmp_oge(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fcmp_olt(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_fcmp_ole(&self, l: LLVMValue, r: LLVMValue) -> LLVMValue

Source

pub fn build_not(&self, val: LLVMValue) -> LLVMValue

Trait Implementations§

Source§

impl Clone for IRBuilder

Source§

fn clone(&self) -> IRBuilder

Returns a duplicate 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 IRBuilder

Source§

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

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

impl Drop for IRBuilder

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for IRBuilder

Source§

impl Sync for IRBuilder

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

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>,

Source§

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.