Skip to main content

LlvmInstr

Enum LlvmInstr 

Source
pub enum LlvmInstr {
Show 39 variants Alloca { result: String, ty: LlvmType, align: Option<u32>, }, Load { result: String, ty: LlvmType, ptr: LlvmValue, align: Option<u32>, }, Store { val: LlvmValue, ty: LlvmType, ptr: LlvmValue, align: Option<u32>, }, Add { result: String, lhs: LlvmValue, rhs: LlvmValue, }, Sub { result: String, lhs: LlvmValue, rhs: LlvmValue, }, Mul { result: String, lhs: LlvmValue, rhs: LlvmValue, }, SDiv { result: String, lhs: LlvmValue, rhs: LlvmValue, }, SRem { result: String, lhs: LlvmValue, rhs: LlvmValue, }, FAdd { result: String, lhs: LlvmValue, rhs: LlvmValue, }, FSub { result: String, lhs: LlvmValue, rhs: LlvmValue, }, FMul { result: String, lhs: LlvmValue, rhs: LlvmValue, }, FDiv { result: String, lhs: LlvmValue, rhs: LlvmValue, }, And { result: String, lhs: LlvmValue, rhs: LlvmValue, }, Or { result: String, lhs: LlvmValue, rhs: LlvmValue, }, Xor { result: String, lhs: LlvmValue, rhs: LlvmValue, }, Shl { result: String, lhs: LlvmValue, rhs: LlvmValue, }, LShr { result: String, lhs: LlvmValue, rhs: LlvmValue, }, AShr { result: String, lhs: LlvmValue, rhs: LlvmValue, }, ICmp { result: String, pred: IcmpPred, lhs: LlvmValue, rhs: LlvmValue, }, FCmp { result: String, pred: FcmpPred, lhs: LlvmValue, rhs: LlvmValue, }, Br(String), CondBr { cond: LlvmValue, true_: String, false_: String, }, Ret(Option<(LlvmType, LlvmValue)>), Unreachable, Label(String), Call { result: Option<String>, ret_ty: LlvmType, func: String, args: Vec<(LlvmType, LlvmValue)>, }, GetElementPtr { result: String, base_ty: LlvmType, ptr: LlvmValue, indices: Vec<(LlvmType, LlvmValue)>, }, BitCast { result: String, val: LlvmValue, from_ty: LlvmType, to_ty: LlvmType, }, Phi { result: String, ty: LlvmType, incoming: Vec<(LlvmValue, String)>, }, Select { result: String, cond: LlvmValue, true_val: LlvmValue, false_val: LlvmValue, ty: LlvmType, }, ExtractValue { result: String, agg: LlvmValue, agg_ty: LlvmType, indices: Vec<u32>, }, InsertValue { result: String, agg: LlvmValue, agg_ty: LlvmType, val: LlvmValue, val_ty: LlvmType, indices: Vec<u32>, }, ZExt { result: String, val: LlvmValue, from_ty: LlvmType, to_ty: LlvmType, }, SExt { result: String, val: LlvmValue, from_ty: LlvmType, to_ty: LlvmType, }, Trunc { result: String, val: LlvmValue, from_ty: LlvmType, to_ty: LlvmType, }, FpToSI { result: String, val: LlvmValue, from_ty: LlvmType, to_ty: LlvmType, }, SIToFp { result: String, val: LlvmValue, from_ty: LlvmType, to_ty: LlvmType, }, FpExt { result: String, val: LlvmValue, from_ty: LlvmType, to_ty: LlvmType, }, FpTrunc { result: String, val: LlvmValue, from_ty: LlvmType, to_ty: LlvmType, },
}
Expand description

LLVM IR instruction.

Variants§

§

Alloca

%result = alloca ty [, align N]

Fields

§result: String
§align: Option<u32>
§

Load

%result = load ty, ptr %ptr [, align N]

Fields

§result: String
§align: Option<u32>
§

Store

store ty %val, ptr %ptr [, align N]

Fields

§align: Option<u32>
§

Add

%result = add i64 %lhs, %rhs

Fields

§result: String
§

Sub

%result = sub i64 %lhs, %rhs

Fields

§result: String
§

Mul

%result = mul i64 %lhs, %rhs

Fields

§result: String
§

SDiv

%result = sdiv i64 %lhs, %rhs

Fields

§result: String
§

SRem

%result = srem i64 %lhs, %rhs

Fields

§result: String
§

FAdd

%result = fadd double %lhs, %rhs

Fields

§result: String
§

FSub

%result = fsub double %lhs, %rhs

Fields

§result: String
§

FMul

%result = fmul double %lhs, %rhs

Fields

§result: String
§

FDiv

%result = fdiv double %lhs, %rhs

Fields

§result: String
§

And

%result = and i64 %lhs, %rhs

Fields

§result: String
§

Or

%result = or i64 %lhs, %rhs

Fields

§result: String
§

Xor

%result = xor i64 %lhs, %rhs

Fields

§result: String
§

Shl

%result = shl i64 %lhs, %rhs

Fields

§result: String
§

LShr

%result = lshr i64 %lhs, %rhs

Fields

§result: String
§

AShr

%result = ashr i64 %lhs, %rhs

Fields

§result: String
§

ICmp

%result = icmp pred i64 %lhs, %rhs

Fields

§result: String
§

FCmp

%result = fcmp pred double %lhs, %rhs

Fields

§result: String
§

Br(String)

br label %target

§

CondBr

br i1 %cond, label %true_, label %false_

Fields

§true_: String
§false_: String
§

Ret(Option<(LlvmType, LlvmValue)>)

ret void or ret ty val

§

Unreachable

unreachable

§

Label(String)

A basic block label: name:

§

Call

[%result = ] call ret_ty @func(args...)

Fields

§result: Option<String>
§ret_ty: LlvmType
§func: String
§

GetElementPtr

%result = getelementptr inbounds base_ty, ptr %ptr, indices...

Fields

§result: String
§base_ty: LlvmType
§indices: Vec<(LlvmType, LlvmValue)>
§

BitCast

%result = bitcast from_ty %val to to_ty

Fields

§result: String
§from_ty: LlvmType
§to_ty: LlvmType
§

Phi

%result = phi ty [ %val1, %bb1 ], [ %val2, %bb2 ]

Fields

§result: String
§incoming: Vec<(LlvmValue, String)>
§

Select

%result = select i1 %cond, ty %true_val, ty %false_val

Fields

§result: String
§true_val: LlvmValue
§false_val: LlvmValue
§

ExtractValue

%result = extractvalue agg_ty %agg, indices...

Fields

§result: String
§agg_ty: LlvmType
§indices: Vec<u32>
§

InsertValue

%result = insertvalue agg_ty %agg, val_ty %val, indices...

Fields

§result: String
§agg_ty: LlvmType
§val_ty: LlvmType
§indices: Vec<u32>
§

ZExt

%result = zext from_ty %val to to_ty

Fields

§result: String
§from_ty: LlvmType
§to_ty: LlvmType
§

SExt

%result = sext from_ty %val to to_ty

Fields

§result: String
§from_ty: LlvmType
§to_ty: LlvmType
§

Trunc

%result = trunc from_ty %val to to_ty

Fields

§result: String
§from_ty: LlvmType
§to_ty: LlvmType
§

FpToSI

%result = fptosi from_ty %val to to_ty

Fields

§result: String
§from_ty: LlvmType
§to_ty: LlvmType
§

SIToFp

%result = sitofp from_ty %val to to_ty

Fields

§result: String
§from_ty: LlvmType
§to_ty: LlvmType
§

FpExt

%result = fpext from_ty %val to to_ty

Fields

§result: String
§from_ty: LlvmType
§to_ty: LlvmType
§

FpTrunc

%result = fptrunc from_ty %val to to_ty

Fields

§result: String
§from_ty: LlvmType
§to_ty: LlvmType

Trait Implementations§

Source§

impl Clone for LlvmInstr

Source§

fn clone(&self) -> LlvmInstr

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 LlvmInstr

Source§

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

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

impl Display for LlvmInstr

Source§

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

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

impl PartialEq for LlvmInstr

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LlvmInstr

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.