Code generation

Targets

LLVM.nameMethod
name(target::Target)

Get the name of the given target.

source
LLVM.hasjitMethod
hasjit(target::Target)

Check if this targets supports the just-in-time compilation.

source

Target machines

LLVM.TargetMachineType
TargetMachine

Primary interface to the complete machine description for the target machine.

All target-specific information should be accessible through this interface.

source
LLVM.disposeMethod
dispose(tm::TargetMachine)

Dispose of the given target machine.

source
LLVM.targetMethod
target(tm::TargetMachine)

Get the target of the given target machine.

source
LLVM.tripleMethod
triple(tm::TargetMachine)

Get the triple of the given target machine.

source
LLVM.cpuMethod
cpu(tm::TargetMachine)

Get the CPU of the given target machine.

source
LLVM.featuresMethod
features(tm::TargetMachine)

Get the feature string of the given target machine.

source
LLVM.asm_verbosity!Function
asm_verbosity!(tm::TargetMachine, verbose::Bool)

Set the verbosity of the target machine's assembly output.

source
LLVM.emitFunction
emit(tm::TargetMachine, mod::Module, filetype::LLVMCodeGenFileType) -> UInt8[]

Generate code for the given module using the target machine, returning the binary data. If assembly code was requested, the binary data can be converted back using String.

source
emit(tm::TargetMachine, mod::Module, filetype::LLVMCodeGenFileType, path::String)

Generate code for the given module using the target machine, writing it to the given file.

source
LLVM.add_transform_info!Function
add_transform_info!(pm::PassManager, [tm::TargetMachine])

Add target-specific analysis passes to the given pass manager.

source
LLVM.add_library_info!Function
add_library_info!(pm::PassManager, triple::String)

Add target-specific library information to the given pass manager.

source
LLVM.JITTargetMachineFunction
JITTargetMachine(; triple=LLVM.triple(), cpu="", features="",
                 optlevel=API.LLVMCodeGenLevelDefault)

Create a target machine suitable for JIT compilation with the ORC JIT.

source

Data layout

LLVM.DataLayoutType
DataLayout

A parsed version of the target data layout string in and methods for querying it.

The target data layout string is specified by the target - a frontend generating LLVM IR is required to generate the right target data for the target being codegen'd to.

source
LLVM.disposeMethod
dispose(data::DataLayout)

Dispose of the given target data layout.

source
LLVM.byteorderFunction
byteorder(data::DataLayout)

Get the byte order of the target data layout.

source
LLVM.pointersizeFunction
pointersize(data::DataLayout, [addrspace::Integer])

Get the pointer size of the target data layout.

source
LLVM.intptrFunction
intptr(data::DataLayout, [addrspace::Integer])

Get the integer type that is the same size as a pointer for the target data layout.

source
Base.sizeofMethod
sizeof(data::DataLayout, typ::LLVMType)

Get the size of the given type in bytes for the target data layout.

source
LLVM.storage_sizeFunction
storage_size(data::DataLayout, typ::LLVMType)

Get the storage size of the given type in bytes for the target data layout.

source
LLVM.abi_sizeFunction
abi_size(data::DataLayout, typ::LLVMType)

Get the ABI size of the given type in bytes for the target data layout.

source
LLVM.abi_alignmentFunction
abi_alignment(data::DataLayout, typ::LLVMType)

Get the ABI alignment of the given type in bytes for the target data layout.

source
LLVM.frame_alignmentFunction
frame_alignment(data::DataLayout, typ::LLVMType)

Get the call frame alignment of the given type in bytes for the target data layout.

source
LLVM.preferred_alignmentFunction
preferred_alignment(data::DataLayout, typ::LLVMType)
preferred_alignment(data::DataLayout, var::GlobalVariable)

Get the preferred alignment of the given type or global variable in bytes for the target data layout.

source
LLVM.element_atFunction
element_at(data::DataLayout, typ::StructType, offset::Integer)

Get the element at the given offset in a struct type for the target data layout.

See also: offsetof.

source
LLVM.offsetofFunction
offsetof(data::DataLayout, typ::StructType, element::Integer)

Get the offset of the given element in a struct type for the target data layout.

See also: element_at.

source