Types
LLVM.LLVMType
— TypeLLVMType
Abstract supertype for all LLVM types.
LLVM.issized
— Functionissized(typ::LLVMType)
Return true if it makes sense to take the size of this type.
Note that this does not mean that it's possible to call sizeof
on this type, as LLVM types sizes can only queried given a target data layout.
See also: sizeof(::DataLayout, ::LLVMType)
.
LLVM.context
— Methodcontext(typ::LLVMType)
Returns the context in which the given type was created.
Base.eltype
— Methodeltype(typ::LLVMType)
Get the element type of the given type, if supported.
Integer types
LLVM.IntegerType
— TypeLLVM.IntegerType <: LLVMType
Type representing arbitrary bit width integers.
LLVM.IntType
— FunctionLLVM.IntType(bits::Integer)
Create an integer type with the given bits
width.
Short-hand constructors are available for common widths: LLVM.Int1Type
, LLVM.Int8Type
, LLVM.Int16Type
, LLVM.Int32Type
, LLVM.Int64Type
, and LLVM.Int128Type
.
LLVM.width
— Functionwidth(inttyp::LLVM.IntegerType)
Get the bit width of the given integer type.
Floating-point types
LLVM.HalfType
— FunctionLLVM.HalfType()
Create a 16-bit floating-point type.
LLVM.BFloatType
— FunctionLLVM.BFloatType()
Create a 16-bit “brain” floating-point type.
LLVM.FloatType
— FunctionLLVM.FloatType()
Create a 32-bit floating-point type.
LLVM.DoubleType
— FunctionLLVM.DoubleType()
Create a 64-bit floating-point type.
LLVM.FP128Type
— FunctionLLVM.FP128Type()
Create a 128-bit floating-point type, with a 113-bit significand.
LLVM.X86FP80Type
— FunctionLLVM.X86FP80Type()
Create a 80-bit, X87 floating-point type.
LLVM.PPCFP128Type
— FunctionLLVM.PPCFP128Type()
Create a 128-bit floating-point type, consisting of two 64-bits.
Function types
LLVM.FunctionType
— TypeLLVM.FunctionType <: LLVMType
A function type, representing a function signature.
LLVM.isvararg
— Functionisvararg(ft::LLVM.FunctionType)
Check whether the given function type is variadic.
LLVM.return_type
— Functionreturn_type(ft::LLVM.FunctionType)
Get the return type of the given function type.
LLVM.parameters
— Methodparameters(ft::LLVM.FunctionType)
Get the parameter types of the given function type.
Pointer types
LLVM.PointerType
— TypeLLVM.PointerType <: LLVMType
A pointer type.
LLVM.addrspace
— Functionaddrspace(ptrtyp::LLVM.PointerType)
Get the address space of the given pointer type.
LLVM.is_opaque
— Functionis_opaque(ptrtyp::LLVM.PointerType)
Check whether the given pointer type is opaque.
Array types
LLVM.ArrayType
— TypeLLVM.ArrayType <: LLVMType
An array type, representing a fixed-size array of identically-typed elements.
Base.length
— Methodlength(arrtyp::LLVM.ArrayType)
Get the length of the given array type.
Base.isempty
— Methodisempty(arrtyp::LLVM.ArrayType)
Check whether the given array type is empty.
Vector types
LLVM.VectorType
— TypeLLVM.VectorType <: LLVMType
A vector type, representing a fixed-size vector of identically-typed elements. Typically used for SIMD operations.
Base.length
— Methodlength(vectyp::LLVM.VectorType)
Get the length of the given vector type.
Structure types
LLVM.StructType
— TypeLLVM.StructType <: LLVMType
A structure type, representing a collection of named fields of potentially different types.
LLVM.name
— Methodname(structtyp::StructType)
Get the name of the given structure type.
LLVM.ispacked
— Functionispacked(structtyp::LLVM.StructType)
Check whether the given structure type is packed.
LLVM.isopaque
— Functionisopaque(structtyp::LLVM.StructType)
Check whether the given structure type is opaque.
LLVM.elements!
— Functionelements!(structtyp::LLVM.StructType, elems::LLVMType[]; packed=false)
Set the elements of the given structure type to elems
. The packed
argument indicates whether the structure should be packed, i.e., without padding between fields.
See also: elements
.
LLVM.elements
— Functionelements(structtyp::LLVM.StructType)
Get the elements of the given structure type.
See also: elements!
.
Other types
LLVM.VoidType
— TypeLLVM.VoidType <: LLVMType
A void type, representing the absence of a value.
LLVM.LabelType
— TypeLLVM.LabelType <: LLVMType
A label type, representing a code label.
LLVM.MetadataType
— TypeLLVM.MetadataType <: LLVMType
A metadata type, representing a metadata value.
LLVM.TokenType
— TypeLLVM.TokenType <: LLVMType
A token type, representing a token value.
Type iteration
LLVM.types
— Functiontypes(ctx::LLVM.Context)
Get a dictionary of all types in the given context.