Void Type
---------
-Overview:
-^^^^^^^^^
+:Overview:
+
The void type does not represent any value and has no size.
-Syntax:
-^^^^^^^
+:Syntax:
+
::
Function Type
-------------
-Overview:
-^^^^^^^^^
+:Overview:
+
The function type can be thought of as a function signature. It consists of a
return type and a list of formal parameter types. The return type of a function
type is a void type or first class type --- except for :ref:`label <t_label>`
and :ref:`metadata <t_metadata>` types.
-Syntax:
-^^^^^^^
+:Syntax:
::
handling intrinsic <int_varargs>` functions. '``<returntype>``' is any type
except :ref:`label <t_label>` and :ref:`metadata <t_metadata>`.
-Examples:
-^^^^^^^^^
+:Examples:
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``i32 (i32)`` | function taking an ``i32``, returning an ``i32`` |
Integer Type
""""""""""""
-Overview:
-*********
+:Overview:
The integer type is a very simple type that simply specifies an
arbitrary bit width for the integer type desired. Any bit width from 1
bit to 2\ :sup:`23`\ -1 (about 8 million) can be specified.
-Syntax:
-*******
+:Syntax:
::
X86mmx Type
"""""""""""
-Overview:
-*********
+:Overview:
The x86mmx type represents a value held in an MMX register on an x86
machine. The operations allowed on it are quite limited: parameters and
and/or results of this type. There are no arrays, vectors or constants
of this type.
-Syntax:
-*******
+:Syntax:
::
Pointer Type
""""""""""""
-Overview:
-*********
+:Overview:
The pointer type is used to specify memory locations. Pointers are
commonly used to reference objects in memory.
Note that LLVM does not permit pointers to void (``void*``) nor does it
permit pointers to labels (``label*``). Use ``i8*`` instead.
-Syntax:
-*******
+:Syntax:
::
<type> *
-Examples:
-*********
+:Examples:
+-------------------------+--------------------------------------------------------------------------------------------------------------+
| ``[4 x i32]*`` | A :ref:`pointer <t_pointer>` to :ref:`array <t_array>` of four ``i32`` values. |
Vector Type
"""""""""""
-Overview:
-*********
+:Overview:
A vector type is a simple derived type that represents a vector of
elements. Vector types are used when multiple primitive data are
requires a size (number of elements) and an underlying primitive data
type. Vector types are considered :ref:`first class <t_firstclass>`.
-Syntax:
-*******
+:Syntax:
::
elementtype may be any integer or floating point type, or a pointer to
these types. Vectors of size zero are not allowed.
-Examples:
-*********
+:Examples:
+-------------------+--------------------------------------------------+
| ``<4 x i32>`` | Vector of 4 32-bit integer values. |
Label Type
^^^^^^^^^^
-Overview:
-"""""""""
+:Overview:
The label type represents code labels.
-Syntax:
-"""""""
+:Syntax:
::
Metadata Type
^^^^^^^^^^^^^
-Overview:
-"""""""""
+:Overview:
The metadata type represents embedded metadata. No derived types may be
created from metadata except for :ref:`function <t_function>` arguments.
-Syntax:
-"""""""
+:Syntax:
::
Array Type
""""""""""
-Overview:
-*********
+:Overview:
The array type is a very simple derived type that arranges elements
sequentially in memory. The array type requires a size (number of
elements) and an underlying data type.
-Syntax:
-*******
+:Syntax:
::
The number of elements is a constant integer value; ``elementtype`` may
be any type with a size.
-Examples:
-*********
+:Examples:
+------------------+--------------------------------------+
| ``[40 x i32]`` | Array of 40 32-bit integer values. |
Structure Type
""""""""""""""
-Overview:
-*********
+:Overview:
The structure type is used to represent a collection of data members
together in memory. The elements of a structure may be any type that has
or opaque since there is no way to write one. Identified types can be
recursive, can be opaqued, and are never uniqued.
-Syntax:
-*******
+:Syntax:
::
%T1 = type { <type list> } ; Identified normal struct type
%T2 = type <{ <type list> }> ; Identified packed struct type
-Examples:
-*********
+:Examples:
+------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ``{ i32, i32, i32 }`` | A triple of three ``i32`` values |
Opaque Structure Types
""""""""""""""""""""""
-Overview:
-*********
+:Overview:
Opaque structure types are used to represent named structure types that
do not have a body specified. This corresponds (for example) to the C
notion of a forward declared structure.
-Syntax:
-*******
+:Syntax:
::
%X = type opaque
%52 = type opaque
-Examples:
-*********
+:Examples:
+--------------+-------------------+
| ``opaque`` | An opaque type. |