Types

LLVM.issizedFunction
issized(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).

source
LLVM.contextMethod
context(typ::LLVMType)

Returns the context in which the given type was created.

source
Base.eltypeMethod
eltype(typ::LLVMType)

Get the element type of the given type, if supported.

source

Integer types

LLVM.IntTypeFunction
LLVM.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.

source
LLVM.widthFunction
width(inttyp::LLVM.IntegerType)

Get the bit width of the given integer type.

source

Floating-point types

LLVM.FP128TypeFunction
LLVM.FP128Type()

Create a 128-bit floating-point type, with a 113-bit significand.

source
LLVM.PPCFP128TypeFunction
LLVM.PPCFP128Type()

Create a 128-bit floating-point type, consisting of two 64-bits.

source

Function types

LLVM.isvarargFunction
isvararg(ft::LLVM.FunctionType)

Check whether the given function type is variadic.

source
LLVM.return_typeFunction
return_type(ft::LLVM.FunctionType)

Get the return type of the given function type.

source
LLVM.parametersMethod
parameters(ft::LLVM.FunctionType)

Get the parameter types of the given function type.

source

Pointer types

LLVM.addrspaceFunction
addrspace(ptrtyp::LLVM.PointerType)

Get the address space of the given pointer type.

source
LLVM.is_opaqueFunction
is_opaque(ptrtyp::LLVM.PointerType)

Check whether the given pointer type is opaque.

source

Array types

LLVM.ArrayTypeType
LLVM.ArrayType <: LLVMType

An array type, representing a fixed-size array of identically-typed elements.

source
Base.lengthMethod
length(arrtyp::LLVM.ArrayType)

Get the length of the given array type.

source
Base.isemptyMethod
isempty(arrtyp::LLVM.ArrayType)

Check whether the given array type is empty.

source

Vector types

LLVM.VectorTypeType
LLVM.VectorType <: LLVMType

A vector type, representing a fixed-size vector of identically-typed elements. Typically used for SIMD operations.

source
Base.lengthMethod
length(vectyp::LLVM.VectorType)

Get the length of the given vector type.

source

Structure types

LLVM.StructTypeType
LLVM.StructType <: LLVMType

A structure type, representing a collection of named fields of potentially different types.

source
LLVM.nameMethod
name(structtyp::StructType)

Get the name of the given structure type.

source
LLVM.ispackedFunction
ispacked(structtyp::LLVM.StructType)

Check whether the given structure type is packed.

source
LLVM.isopaqueFunction
isopaque(structtyp::LLVM.StructType)

Check whether the given structure type is opaque.

source
LLVM.elements!Function
elements!(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.

source

Other types

LLVM.VoidTypeType
LLVM.VoidType <: LLVMType

A void type, representing the absence of a value.

source

Type iteration

LLVM.typesFunction
types(ctx::LLVM.Context)

Get a dictionary of all types in the given context.

source