Code generation
Targets
LLVM.Target — TypeTargetA structure exposing target-specific information.
LLVM.name — Methodname(target::Target)Get the name of the given target.
LLVM.description — Methoddescription(target::Target)Get a short description of the given target.
LLVM.hasjit — Methodhasjit(target::Target)Check if this targets supports the just-in-time compilation.
LLVM.hastargetmachine — Methodhastargetmachine(target::Target)Check if this target supports code generation.
LLVM.hasasmparser — Methodhasasmparser(target::Target)Check if this target supports assembly parsing.
LLVM.targets — Functiontargets()Get an iterator over the available targets.
Target machines
LLVM.TargetMachine — TypeTargetMachinePrimary interface to the complete machine description for the target machine.
All target-specific information should be accessible through this interface.
LLVM.dispose — Methoddispose(tm::TargetMachine)Dispose of the given target machine.
LLVM.target — Methodtarget(tm::TargetMachine)Get the target of the given target machine.
LLVM.triple — Methodtriple(tm::TargetMachine)Get the triple of the given target machine.
LLVM.triple — Methodtriple()Get the default target triple.
LLVM.normalize — Methodnormalize(triple::String)Normalize the given target triple.
LLVM.cpu — Methodcpu(tm::TargetMachine)Get the CPU of the given target machine.
LLVM.features — Methodfeatures(tm::TargetMachine)Get the feature string of the given target machine.
LLVM.asm_verbosity! — Functionasm_verbosity!(tm::TargetMachine, verbose::Bool)Set the verbosity of the target machine's assembly output.
LLVM.emit — Functionemit(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! — Functionadd_transform_info!(pm::PassManager, [tm::TargetMachine])Add target-specific analysis passes to the given pass manager.
LLVM.add_library_info! — Functionadd_library_info!(pm::PassManager, triple::String)Add target-specific library information to the given pass manager.
LLVM.JITTargetMachine — FunctionJITTargetMachine(; triple=LLVM.triple(), cpu="", features="",
                 optlevel=API.LLVMCodeGenLevelDefault)Create a target machine suitable for JIT compilation with the ORC JIT.
Data layout
LLVM.DataLayout — TypeDataLayoutA 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 — Methoddispose(dl::DataLayout)Dispose of the given target data layout.
LLVM.byteorder — Functionbyteorder(dl::DataLayout)Get the byte order of the target data layout.
LLVM.pointersize — Functionpointersize(dl::DataLayout, [addrspace::Integer])Get the pointer size of the target data layout.
LLVM.intptr — Functionintptr(dl::DataLayout, [addrspace::Integer])Get the integer type that is the same size as a pointer for the target data layout.
LLVM.globals_addrspace — Functionglobals_addrspace(dl::DataLayout)Get the address space used for global variables in the target data layout.
Base.sizeof — Methodsizeof(dl::DataLayout, typ::LLVMType)Get the size of the given type in bytes for the target data layout.
LLVM.storage_size — Functionstorage_size(dl::DataLayout, typ::LLVMType)Get the storage size of the given type in bytes for the target data layout.
LLVM.abi_size — Functionabi_size(dl::DataLayout, typ::LLVMType)Get the ABI size of the given type in bytes for the target data layout.
LLVM.abi_alignment — Functionabi_alignment(dl::DataLayout, typ::LLVMType)Get the ABI alignment of the given type in bytes for the target data layout.
LLVM.frame_alignment — Functionframe_alignment(dl::DataLayout, typ::LLVMType)Get the call frame alignment of the given type in bytes for the target data layout.
LLVM.preferred_alignment — Functionpreferred_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 — Functionelement_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 — Functionoffsetof(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.