Type references

A type reference wraps an LLVM type. It allows accessing type’s name and IR representation. It is also accepted by methods like TargetData.get_abi_size().

The TypeRef class

class llvmlite.binding.TypeRef

A wrapper around an LLVM type. The attributes available are:

  • llvmlite.binding.name

    This type’s name, as a string.

  • llvmlite.binding.is_pointer
    • True—The type is a pointer type

    • False—The type is not a pointer type

  • llvmlite.binding.element_type

    If the type is a pointer, return the pointed-to type. Raises a ValueError if the type is not a pointer type.

  • llvmlite.binding.__str__(self)

    Get the string IR representation of the type.