[LangRef] Update opaque pointers status (NFC)

Opaque pointers support is complete and default. Specify ptr as
the normal pointer type and i8* as something supported under
non-default options.

A larger update of examples in LangRef is still needed.
This commit is contained in:
Nikita Popov 2022-07-22 14:46:01 +02:00
parent 4839929bed
commit 5ab077f911
1 changed files with 7 additions and 32 deletions

View File

@ -3565,44 +3565,19 @@ Pointer Type
:Overview:
The pointer type is used to specify memory locations. Pointers are
The pointer type ``ptr`` is used to specify memory locations. Pointers are
commonly used to reference objects in memory.
Pointer types may have an optional address space attribute defining the
numbered address space where the pointed-to object resides. The default
address space is number zero. The semantics of non-zero address spaces
are target-specific.
are target-specific. For example, ``ptr addrspace(5)`` is a pointer
to address space 5.
Note that LLVM does not permit pointers to void (``void*``) nor does it
permit pointers to labels (``label*``). Use ``i8*`` instead.
LLVM is in the process of transitioning to
`opaque pointers <OpaquePointers.html#opaque-pointers>`_.
Opaque pointers do not have a pointee type. Rather, instructions
interacting through pointers specify the type of the underlying memory
they are interacting with. Opaque pointers are still in the process of
being worked on and are not complete.
:Syntax:
::
<type> *
ptr
:Examples:
+-------------------------+--------------------------------------------------------------------------------------------------------------+
| ``[4 x i32]*`` | A :ref:`pointer <t_pointer>` to :ref:`array <t_array>` of four ``i32`` values. |
+-------------------------+--------------------------------------------------------------------------------------------------------------+
| ``i32 (i32*) *`` | A :ref:`pointer <t_pointer>` to a :ref:`function <t_function>` that takes an ``i32*``, returning an ``i32``. |
+-------------------------+--------------------------------------------------------------------------------------------------------------+
| ``i32 addrspace(5)*`` | A :ref:`pointer <t_pointer>` to an ``i32`` value that resides in address space 5. |
+-------------------------+--------------------------------------------------------------------------------------------------------------+
| ``ptr`` | An opaque pointer type to a value that resides in address space 0. |
+-------------------------+--------------------------------------------------------------------------------------------------------------+
| ``ptr addrspace(5)`` | An opaque pointer type to a value that resides in address space 5. |
+-------------------------+--------------------------------------------------------------------------------------------------------------+
Prior to LLVM 15, pointer types also specified a pointee type, such as
``i8*``, ``[4 x i32]*`` or ``i32 (i32*)*``. In LLVM 15, such "typed
pointers" are still supported under non-default options. See the
`opaque pointers document <OpaquePointers.html>`__ for more information.
.. _t_vector: