From 5ab077f911ced8f9ab53fcfcc40b254fd1ca7edd Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 22 Jul 2022 14:46:01 +0200 Subject: [PATCH] [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. --- llvm/docs/LangRef.rst | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index 9464b20..55eabc3 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -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 `_. -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: - -:: - - * - ptr - -:Examples: - -+-------------------------+--------------------------------------------------------------------------------------------------------------+ -| ``[4 x i32]*`` | A :ref:`pointer ` to :ref:`array ` of four ``i32`` values. | -+-------------------------+--------------------------------------------------------------------------------------------------------------+ -| ``i32 (i32*) *`` | A :ref:`pointer ` to a :ref:`function ` that takes an ``i32*``, returning an ``i32``. | -+-------------------------+--------------------------------------------------------------------------------------------------------------+ -| ``i32 addrspace(5)*`` | A :ref:`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 `__ for more information. .. _t_vector: -- 2.7.4