layout: page |
title: Type (llvm.core) |
Create an integer type of bit width n.
Create a 32-bit floating point type.
Create a 64-bit floating point type.
Create a 80-bit 80x87-style floating point type.
Create a 128-bit floating point type (112-bit mantissa).
Create a 128-bit float (two 64-bits).
Create a function type, having the return type ret (must be a Type), accepting the parameters params, where params is an iterable, that yields Type objects representing the type of each function argument in order. If vararg is True, function is variadic.
Create an unpacked structure. eltys is an iterable, that yields Type objects representing the type of each element in order.
If name is evaulates True (not empty), create an identified structure; otherwise, create a literal structure by default.
Like struct(eltys), but creates a packed struct.
Creates an array type, holding count elements, each of type elty (which should be a Type).
Create a pointer to type pty (which should be a Type). addrspc is an integer that represents the address space of the pointer (see LLVM docs or ask on llvm-dev for more info).
Creates a void type. Used for function return types.
Creates a label type.
Opaque StructType, used for creating self-referencing types.
[read-only]
A value (enum) representing the “type” of the object. It will be one of the following constants defined in llvm.core:
# Warning: do not rely on actual numerical
values! TYPE_VOID = 0 TYPE_FLOAT = 1 TYPE_DOUBLE = 2 TYPE_X86_FP80
= 3 TYPE_FP128 = 4 TYPE_PPC_FP128 = 5 TYPE_LABEL = 6 TYPE_INTEGER =
7 TYPE_FUNCTION = 8 TYPE_STRUCT = 9 TYPE_ARRAY = 10 TYPE_POINTER =
11 TYPE_OPAQUE = 12 TYPE_VECTOR = 13 TYPE_METADATA = 14 TYPE_UNION =
15
assert Type.int().kind == TYPE_INTEGER assert
Type.void().kind == TYPE_VOID
Represents a type, like a 32-bit integer or an 80-bit x86 float.
Use one of the static methods to create an instance. Example: ty = Type.double()
Create an array type.
Creates a type for an array of elements of type `element_ty’, having ‘count’ elements.
Create a 64-bit floating point type.
Create a 32-bit floating point type.
Create a 128-bit floating point type (with 112-bit mantissa).
Create a function type.
Creates a function type that returns a value of type `return_ty’, takes arguments of types as given in the iterable `param_tys’. Set `var_arg’ to True (default is False) for a variadic function.
Create an integer type having the given bit width.
Create a label type.
Create a opaque StructType
Create a (packed) structure type.
Creates a structure type with elements of types as given in the iterable `element_tys’. This method creates a packed structure. For an unpacked one, use the struct() method.
If name is not ‘’, creates a identified type; otherwise, creates a literal type.
Create a pointer type.
Creates a pointer type, which can point to values of type `pointee_ty’, in the address space `addr_space’.
Create a 128-bit floating point type (two 64-bits).
Create a (unpacked) structure type.
Creates a structure type with elements of types as given in the iterable `element_tys’. This method creates a unpacked structure. For a packed one, use the packed_struct() method.
If name is not ‘’, creates a identified type; otherwise, creates a literal type.
Create a vector type.
Creates a type for a vector of elements of type `element_ty’, having `count’ elements.
Create a 80-bit x86 floating point type.