Functions
LLVM.Function — TypeLLVM.FunctionA function in the IR.
LLVM.Function — MethodLLVM.Function(mod::Module, name::String, ft::FunctionType)Create a new function in the given module with the given name and function type.
Properties and operations
LLVM.function_type — Functionfunction_type(f::Function) -> LLVM.FunctionTypeGet the function type of the given function. This returns a function type, as opposed to value_type which returns the pointer type of the function constant.
Base.empty! — Functionempty!(f::Function)Delete the body of the given function, and convert the linkage to external.
LLVM.erase! — Methoderase!(f::Function)Remove the given function from its parent module and free the object.
This function is unsafe because it does not check if the function is used elsewhere.
LLVM.personality — Functionpersonality(f::Function)Get the personality function of the given function, or nothing if it has none.
LLVM.personality! — Functionpersonality!(f::Function, persfn::Function)Set the personality function of the given function. Pass nothing to remove the personality function.
LLVM.callconv — Functioncallconv(f::Function)Get the calling convention of the given function.
callconv(call_inst::Instruction)Get the calling convention of the given callable instruction.
LLVM.callconv! — Functioncallconv!(f::Function, cc)Set the calling convention of the given function.
callconv!(call_inst::Instruction, cc)Set the calling convention of the given callable instruction.
LLVM.gc — Functiongc(f::Function)Get the garbage collector name of the given function, or an empty string if it has none.
LLVM.gc! — Functiongc!(f::Function, name::String)Set the garbage collector name of the given function.
LLVM.entry — Functionentry(f::Function) -> BasicBlockGet the entry basic block of the given function.
Attributes
LLVM.function_attributes — Functionfunction_attributes(f::Function)Get the attributes of the given function.
This is a mutable iterator, supporting push!, append! and delete!.
LLVM.parameter_attributes — Functionparameter_attributes(f::Function, idx::Integer)Get the attributes of the given parameter of the given function.
This is a mutable iterator, supporting push!, append! and delete!.
LLVM.return_attributes — Functionreturn_attributes(f::Function)Get the attributes of the return value of the given function.
This is a mutable iterator, supporting push!, append! and delete!.
Parameters
LLVM.parameters — Functionparameters(ft::LLVM.FunctionType)Get the parameter types of the given function type.
parameters(f::Function)Get an iterator over the parameters of the given function. These are values that can be used as inputs to other instructions.
Basic Blocks
LLVM.blocks — Functionblocks(f::Function)Get an iterator over the basic blocks of the given function.
LLVM.prevblock — Functionprevblock(bb::BasicBlock)Get the previous basic block of the given basic block, or nothing if there is none.
LLVM.nextblock — Functionnextblock(bb::BasicBlock)Get the next basic block of the given basic block, or nothing if there is none.
Intrinsics
LLVM.isintrinsic — Functionisintrinsic(f::Function)Check if the given function is an intrinsic.
LLVM.isoverloaded — Functionisoverloaded(intr::Intrinsic)Check if the given intrinsic is overloaded.
LLVM.name — Methodname(intr::LLVM.Intrinsic)Get the name of the given intrinsic.
LLVM.name — Methodname(intr::LLVM.Intrinsic, params::Vector{<:LLVMType})Get the name of the given overloaded intrinsic with the given parameter types.
LLVM.Function — MethodFunction(mod::Module, intr::Intrinsic, params::Vector{<:LLVMType}=LLVMType[])Get the declaration of the given intrinsic in the given module.
LLVM.FunctionType — MethodFunctionType(intr::Intrinsic, params::Vector{<:LLVMType}=LLVMType[])Get the function type of the given intrinsic with the given parameter types.