Code generation
Targets
LLVM.Target — Type
TargetA structure exposing target-specific information.
LLVM.description — Method
description(target::Target)Get a short description of the given target.
LLVM.hasjit — Method
hasjit(target::Target)Check if this targets supports the just-in-time compilation.
LLVM.hastargetmachine — Method
hastargetmachine(target::Target)Check if this target supports code generation.
LLVM.hasasmparser — Method
hasasmparser(target::Target)Check if this target supports assembly parsing.
LLVM.targets — Function
targets()Get an iterator over the available targets.
Target machines
LLVM.TargetMachine — Type
TargetMachinePrimary interface to the complete machine description for the target machine.
All target-specific information should be accessible through this interface.
LLVM.dispose — Method
dispose(tm::TargetMachine)Dispose of the given target machine.
LLVM.target — Method
target(tm::TargetMachine)Get the target of the given target machine.
LLVM.triple — Method
triple(tm::TargetMachine)Get the triple of the given target machine.
LLVM.triple — Method
triple()Get the default target triple.
LLVM.normalize — Method
normalize(triple::String)Normalize the given target triple.
LLVM.features — Method
features(tm::TargetMachine)Get the feature string of the given target machine.
LLVM.asm_verbosity! — Function
asm_verbosity!(tm::TargetMachine, verbose::Bool)Set the verbosity of the target machine's assembly output.
LLVM.emit — Function
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.
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.
LLVM.add_transform_info! — Function
add_transform_info!(pm::PassManager, [tm::TargetMachine])Add target-specific analysis passes to the given pass manager.
LLVM.add_library_info! — Function
add_library_info!(pm::PassManager, triple::String)Add target-specific library information to the given pass manager.
LLVM.JITTargetMachine — Function
JITTargetMachine(; triple=LLVM.triple(), cpu="", features="",
optlevel=API.LLVMCodeGenLevelDefault)Create a target machine suitable for JIT compilation with the ORC JIT.
Data layout
LLVM.DataLayout — Type
DataLayoutA 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.
LLVM.dispose — Method
dispose(dl::DataLayout)Dispose of the given target data layout.
LLVM.byteorder — Function
byteorder(dl::DataLayout)Get the byte order of the target data layout.
LLVM.pointersize — Function
pointersize(dl::DataLayout, [addrspace::Integer])Get the pointer size of the target data layout.
LLVM.intptr — Function
intptr(dl::DataLayout, [addrspace::Integer])Get the integer type that is the same size as a pointer for the target data layout.
LLVM.globals_addrspace — Function
globals_addrspace(dl::DataLayout)Get the address space used for global variables in the target data layout.
Base.sizeof — Method
sizeof(dl::DataLayout, typ::LLVMType)Get the size of the given type in bytes for the target data layout.
LLVM.storage_size — Function
storage_size(dl::DataLayout, typ::LLVMType)Get the storage size of the given type in bytes for the target data layout.
LLVM.abi_size — Function
abi_size(dl::DataLayout, typ::LLVMType)Get the ABI size of the given type in bytes for the target data layout.
LLVM.abi_alignment — Function
abi_alignment(dl::DataLayout, typ::LLVMType)Get the ABI alignment of the given type in bytes for the target data layout.
LLVM.frame_alignment — Function
frame_alignment(dl::DataLayout, typ::LLVMType)Get the call frame alignment of the given type in bytes for the target data layout.
LLVM.preferred_alignment — Function
preferred_alignment(dl::DataLayout, typ::LLVMType)
preferred_alignment(dl::DataLayout, var::GlobalVariable)Get the preferred alignment of the given type or global variable in bytes for the target data layout.
LLVM.element_at — Function
element_at(dl::DataLayout, typ::StructType, offset::Integer)Get the element at the given offset in a struct type for the target data layout.
See also: offsetof.
LLVM.offsetof — Function
offsetof(dl::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.