Functions

LLVM.FunctionMethod
LLVM.Function(mod::Module, name::String, ft::FunctionType)

Create a new function in the given module with the given name and function type.

source

Properties and operations

LLVM.function_typeFunction
function_type(f::Function) -> LLVM.FunctionType

Get 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.

source
Base.empty!Function
empty!(f::Function)

Delete the body of the given function, and convert the linkage to external.

source
LLVM.erase!Method
erase!(f::Function)

Remove the given function from its parent module and free the object.

Warning

This function is unsafe because it does not check if the function is used elsewhere.

source
LLVM.personalityFunction
personality(f::Function)

Get the personality function of the given function, or nothing if it has none.

source
LLVM.personality!Function
personality!(f::Function, persfn::Function)

Set the personality function of the given function. Pass nothing to remove the personality function.

source
LLVM.callconvFunction
callconv(f::Function)

Get the calling convention of the given function.

source
callconv(call_inst::Instruction)

Get the calling convention of the given callable instruction.

source
LLVM.callconv!Function
callconv!(f::Function, cc)

Set the calling convention of the given function.

source
callconv!(call_inst::Instruction, cc)

Set the calling convention of the given callable instruction.

source
LLVM.gcFunction
gc(f::Function)

Get the garbage collector name of the given function, or an empty string if it has none.

source
LLVM.gc!Function
gc!(f::Function, name::String)

Set the garbage collector name of the given function.

source
LLVM.entryFunction
entry(f::Function) -> BasicBlock

Get the entry basic block of the given function.

source

Attributes

LLVM.function_attributesFunction
function_attributes(f::Function)

Get the attributes of the given function.

This is a mutable iterator, supporting push!, append! and delete!.

source
LLVM.parameter_attributesFunction
parameter_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!.

source
LLVM.return_attributesFunction
return_attributes(f::Function)

Get the attributes of the return value of the given function.

This is a mutable iterator, supporting push!, append! and delete!.

source

Parameters

LLVM.parametersFunction
parameters(ft::LLVM.FunctionType)

Get the parameter types of the given function type.

source
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.

source

Basic Blocks

LLVM.blocksFunction
blocks(f::Function)

Get an iterator over the basic blocks of the given function.

source
LLVM.prevblockFunction
prevblock(bb::BasicBlock)

Get the previous basic block of the given basic block, or nothing if there is none.

source
LLVM.nextblockFunction
nextblock(bb::BasicBlock)

Get the next basic block of the given basic block, or nothing if there is none.

source

Intrinsics

LLVM.nameMethod
name(intr::LLVM.Intrinsic)

Get the name of the given intrinsic.

source
LLVM.nameMethod
name(intr::LLVM.Intrinsic, params::Vector{<:LLVMType})

Get the name of the given overloaded intrinsic with the given parameter types.

source
LLVM.FunctionMethod
Function(mod::Module, intr::Intrinsic, params::Vector{<:LLVMType}=LLVMType[])

Get the declaration of the given intrinsic in the given module.

source
LLVM.FunctionTypeMethod
FunctionType(intr::Intrinsic, params::Vector{<:LLVMType}=LLVMType[])

Get the function type of the given intrinsic with the given parameter types.

source