Values
General APIs
LLVM.Value — Type
LLVM.ValueAbstract type representing an LLVM value.
LLVM.value_type — Function
value_type(val::Value)Get the type of the given value.
LLVM.context — Method
context(val::LLVM.Value)Return the context in which the given value was created.
LLVM.name! — Method
name!(val::Value, name::String)Set the name of the given value.
LLVM.isconstant — Method
isconstant(val::LLVM.Value)Check if the given value is a constant value.
LLVM.isundef — Function
isundef(val::LLVM.Value)Check if the given value is an undef value.
LLVM.ispoison — Function
ispoison(val::LLVM.Value)Check if the given value is a poison value.
LLVM.isnull — Function
isnull(val::LLVM.Value)Check if the given value is a null constant.
User values
LLVM.operands — Method
operands(user::LLVM.User)Get an iterator over the operands of the given user.
Constant values
LLVM.Constant — Type
LLVM.Constant <: LLVM.UserAbstract supertype for all constant values.
LLVM.all_ones — Function
all_ones(typ::LLVMType)Create a constant with all bits set to one of the given type.
LLVM.PointerNull — Type
PointerNull <: LLVM.ConstantDataA null pointer constant.
LLVM.UndefValue — Type
UndefValue <: LLVM.ConstantDataAn undefined constant value.
LLVM.PoisonValue — Type
PoisonValue <: LLVM.ConstantDataA poison constant value.
LLVM.ConstantInt — Type
ConstantInt <: LLVM.ConstantDataA constant integer value.
Base.convert — Method
convert(::Type{<:Integer}, val::ConstantInt)Convert a constant integer value back to a Julia integer.
LLVM.ConstantFP — Type
ConstantFP <: LLVM.ConstantDataA constant floating point value.
Base.convert — Method
convert(::Type{<:AbstractFloat}, val::ConstantFP)Convert a constant floating point value back to a Julia floating point number.
LLVM.ConstantStruct — Type
ConstantStruct <: LLVM.ConstantAggregateA constant struct of values.
LLVM.ConstantDataArray — Type
ConstantDataArray <: LLVM.ConstantDataSequentialA constant array of simple data values, i.e., whose element type is a simple 1/2/4/8-byte integer or half/bfloat/float/double, and whose elements are just simple data values
See also: ConstantArray
LLVM.ConstantDataArray — Method
ConstantDataArray(typ::LLVMType, data::AbstractVector)Create a constant array of simple data values of the given type and data.
LLVM.ConstantDataArray — Method
ConstantDataArray(data::AbstractVector)Create a constant array of simple data values from a Julia vector.
LLVM.ConstantDataVector — Type
ConstantDataVector <: LLVM.ConstantDataSequentialA constant vector of simple data values, i.e., whose element type is a simple 1/2/4/8-byte integer or half/bfloat/float/double, and whose elements are just simple data values
LLVM.ConstantArray — Type
ConstantArray <: LLVM.ConstantAggregateA constant array of values.
This type implements the Julia array interface, so (to some extent) it can be used as a regular Julia array.
LLVM.ConstantArray — Method
ConstantArray(typ::LLVMType, data::AbstractArray)Create a constant array of values of the given type and data.
When using simple data types, this constructor can also return a ConstantDataArray.
LLVM.ConstantArray — Method
ConstantArray(data::AbstractArray)Create a constant array of values from a Julia array, using the appropriate constant type.
Base.collect — Method
collect(ca::ConstantArray)Convert a constant array back to a Julia array.
LLVM.InlineAsm — Type
InlineAsm <: LLVM.ConstantA constant inline assembly block.
LLVM.ConstantExpr — Type
LLVM.ConstantExpr <: LLVM.ConstantA constant value that is initialized with an expression using other constant values.
Constant expressions are created using const_-prefixed functions, which correspond to the LLVM IR instructions: const_neg, const_not, etc.
Global values
LLVM.GlobalValue — Type
LLVM.GlobalValue <: LLVM.ConstantAbstract supertype for all global values.
LLVM.global_value_type — Function
global_value_type(val::LLVM.GlobalValue)Get the type of the global value.
This differs from value_type in that it returns the type of the contained value, not the type of the global value itself which is always a pointer type.
LLVM.parent — Method
parent(val::LLVM.GlobalValue)Get the parent module of the global value.
LLVM.isdeclaration — Function
isdeclaration(val::LLVM.GlobalValue)Check if the global value is a declaration, i.e. it does not have a definition.
LLVM.linkage — Function
linkage(val::LLVM.GlobalValue)Get the linkage of the global value.
LLVM.linkage! — Function
linkage!(val::LLVM.GlobalValue, linkage::LLVM.LLVMLinkage)Set the linkage of the global value.
LLVM.section — Function
section(val::LLVM.GlobalValue)Get the section of the global value.
LLVM.section! — Function
section!(val::LLVM.GlobalValue, sec::String)Set the section of the global value.
LLVM.visibility — Function
visibility(val::LLVM.GlobalValue)Get the visibility of the global value.
LLVM.visibility! — Function
visibility!(val::LLVM.GlobalValue, viz::LLVM.LLVMVisibility)Set the visibility of the global value.
LLVM.dllstorage — Function
dllstorage(val::LLVM.GlobalValue)Get the DLL storage class of the global value.
LLVM.dllstorage! — Function
dllstorage!(val::LLVM.GlobalValue, storage::LLVM.LLVMDLLStorageClass)Set the DLL storage class of the global value.
LLVM.unnamed_addr — Function
unnamed_addr(val::LLVM.GlobalValue)Check if the global value has the unnamed address flag set.
LLVM.unnamed_addr! — Function
unnamed_addr!(val::LLVM.GlobalValue, flag::Bool)Set the unnamed address flag of the global value.
LLVM.local_unnamed_addr — Function
local_unnamed_addr(val::LLVM.GlobalValue)Check if the global value has the local unnamed address flag set.
LLVM.local_unnamed_addr! — Function
local_unnamed_addr!(val::LLVM.GlobalValue, flag::Bool)Set the local unnamed address flag of the global value.
Global variables
Global variables are a specific kind of global values, and have additional APIs:
LLVM.GlobalVariable — Type
GlobalVariable <: LLVM.GlobalObjectA global variable.
LLVM.erase! — Method
erase!(gv::GlobalVariable)Remove the global variable from its parent module and delete it.
LLVM.initializer — Function
initializer(gv::GlobalVariable)Get the initializer of the global variable.
LLVM.initializer! — Function
initializer!(gv::GlobalVariable, val::Constant)Set the initializer of the global variable. Setting the value to nothing removes the current initializer.
LLVM.isthreadlocal — Function
isthreadlocal(gv::GlobalVariable)Check if the global variable is thread-local.
LLVM.threadlocal! — Function
threadlocal!(gv::GlobalVariable, flag::Bool)Set the thread-local flag of the global variable.
LLVM.threadlocalmode — Function
threadlocalmode(gv::GlobalVariable)Get the thread-local mode of the global variable.
LLVM.threadlocalmode! — Function
threadlocalmode!(gv::GlobalVariable, mode::LLVM.LLVMThreadLocalMode)Set the thread-local mode of the global variable.
LLVM.isconstant — Method
isconstant(gv::GlobalVariable)Check if the global variable is a global constant, i.e., its value is immutable throughout the runtime execution of the program.
LLVM.constant! — Function
constant!(gv::GlobalVariable, flag::Bool)Set the constant flag of the global variable.
LLVM.isextinit — Function
isextinit(gv::GlobalVariable)Check if the global variable is externally initialized.
LLVM.extinit! — Function
extinit!(gv::GlobalVariable, flag::Bool)Set the externally initialized flag of the global variable.
LLVM.alignment — Method
alignment(gv::GlobalVariable)Get the alignment of the global variable.
LLVM.alignment! — Method
alignment!(gv::GlobalVariable, bytes::Integer)Set the alignment of the global variable.
Uses
LLVM.replace_uses! — Function
replace_uses!(old::LLVM.Value, new::LLVM.Value)Replace all uses of an old value in the IR with new.
This does not replace uses in metadata, which must be done separately with replace_metadata_uses!.
LLVM.replace_metadata_uses! — Function
replace_metadata_uses!(old::LLVM.Value, new::LLVM.Value)Replace all uses of an old value in metadata with new.
LLVM.value — Function
value(use::LLVM.Use)Get the used value of the given use.