Enum ValueKind

Source
pub enum ValueKind {
Show 28 variants Argument, BasicBlock, MemoryUse, MemoryDef, MemoryPhi, Function, GlobalAlias, GlobalIFunc, GlobalVariable, BlockAddress, ConstantExpr, ConstantArray, ConstantStruct, ConstantVector, Undef, ConstantAggregateZero, ConstantDataArray, ConstantDataVector, ConstantInt, ConstantFP, ConstantPointerNull, ConstantTokenNone, MetadataAsValue, InlineAsm, Instruction, Poison, ConstantTargetNone, ConstantPtrAuthValueKind,
}
Expand description

Represents the different kinds of values in LLVM IR.

The ValueKind enum categorizes the various types of values that can exist within LLVM IR. Each variant of this enum corresponds to a specific kind of value or entity in the LLVM IR, such as a function, global variable, instruction, or constant. This enum is useful for identifying the type of a value when working with LLVM IR structures.

Variants§

§

Argument

Represents a function argument. Each argument passed to a function is an instance of this kind.

§

BasicBlock

Represents a basic block within a function. Basic blocks are the building blocks of a function’s control flow.

§

MemoryUse

Represents a memory use in the MemorySSA. This kind tracks the use of memory locations within SSA form.

§

MemoryDef

Represents a memory definition in the MemorySSA. This kind tracks the definition of memory locations within SSA form.

§

MemoryPhi

Represents a memory PHI node in the MemorySSA. This kind handles merging memory states from different control flow paths.

§

Function

Represents a function. Functions are the primary callable entities in LLVM IR.

§

GlobalAlias

Represents a global alias. Global aliases are alternative names for global variables or functions.

§

GlobalIFunc

Represents an indirect function. This is a function pointer that can be resolved at runtime to a specific implementation.

§

GlobalVariable

Represents a global variable. Global variables are variables that are globally accessible across the entire module.

§

BlockAddress

Represents a block address. This is used to refer to the address of a basic block within a function.

§

ConstantExpr

Represents a constant expression. Constant expressions are constant values that are computed at compile time from other constants.

§

ConstantArray

Represents a constant array. Constant arrays are arrays whose elements are all constant values.

§

ConstantStruct

Represents a constant struct. Constant structs are structures whose fields are all constant values.

§

ConstantVector

Represents a constant vector. Constant vectors are vectors whose elements are all constant values.

§

Undef

Represents an undefined value. Undefined values are placeholders that can take any value of their type during execution.

§

ConstantAggregateZero

Represents a constant aggregate with all elements set to zero. This includes arrays, structs, and vectors with all elements set to zero.

§

ConstantDataArray

Represents a constant data array. These are arrays of simple data types like integers or floating-point numbers, stored as constants.

§

ConstantDataVector

Represents a constant data vector. These are vectors of simple data types like integers or floating-point numbers, stored as constants.

§

ConstantInt

Represents a constant integer. Constant integers are fixed integer values known at compile time.

§

ConstantFP

Represents a constant floating-point value. Constant floating-point values are fixed floating-point numbers known at compile time.

§

ConstantPointerNull

Represents a constant null pointer. This is a pointer that is explicitly set to null.

§

ConstantTokenNone

Represents a constant token with no value. Used in certain intrinsic functions that deal with tokens.

§

MetadataAsValue

Represents metadata used as a value. Metadata can be used to store extra information for optimizations, debugging, or analysis.

§

InlineAsm

Represents inline assembly code. Inline assembly allows embedding low-level assembly code within LLVM IR.

§

Instruction

Represents an instruction. Instructions are the individual operations that make up the body of functions.

§

Poison

Represents a poison value. Poison values result from operations with undefined behavior and can propagate to cause further undefined behavior.

§

ConstantTargetNone

Represents a target-specific constant value that has no direct representation in the source code.

§

ConstantPtrAuthValueKind

Represents a constant pointer with pointer authentication. This is a pointer with additional authentication information.

Trait Implementations§

Source§

impl Clone for ValueKind

Source§

fn clone(&self) -> ValueKind

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 ValueKind

Source§

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

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

impl From<LLVMValueKind> for ValueKind

Source§

fn from(value: LLVMValueKind) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for ValueKind

Source§

fn eq(&self, other: &ValueKind) -> 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 Copy for ValueKind

Source§

impl Eq for ValueKind

Source§

impl StructuralPartialEq for ValueKind

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.