From b0ce6a0ae5e34af704f7c6f3811399b5f40f8188 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 2 Jun 2022 12:28:12 +0200 Subject: [PATCH] [Docs] Update default in opaque pointer docs (NFC) Also mention a relevant C API. --- llvm/docs/OpaquePointers.rst | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/llvm/docs/OpaquePointers.rst b/llvm/docs/OpaquePointers.rst index a576c1325b91..f4a99fc100cc 100644 --- a/llvm/docs/OpaquePointers.rst +++ b/llvm/docs/OpaquePointers.rst @@ -62,12 +62,12 @@ Opaque Pointers Mode ==================== During the transition phase, LLVM can be used in two modes: In typed pointer -mode (currently still the default) all pointer types have a pointee type and -opaque pointers cannot be used. In opaque pointers mode, all pointers are -opaque. The opaque pointer mode can be enabled using ``-opaque-pointers`` in -LLVM tools like ``opt``, or ``-Xclang -opaque-pointers`` in clang. Additionally, -opaque pointer mode is automatically enabled for IR and bitcode files that use -the ``ptr`` type. +mode all pointer types have a pointee type and opaque pointers cannot be used. +In opaque pointers mode (the default), all pointers are opaque. The opaque +pointer mode can be disabled using ``-opaque-pointers=0`` in +LLVM tools like ``opt``, or ``-Xclang -no-opaque-pointers`` in clang. +Additionally, opaque pointer mode is automatically disabled for IR and bitcode +files that explicitly mention ``i8*`` style typed pointers. In opaque pointer mode, all typed pointers used in IR, bitcode, or created using ``PointerType::get()`` and similar APIs are automatically converted into @@ -191,6 +191,9 @@ opaque pointer transition:: Additionally, it will no longer be possible to call ``LLVMGetElementType()`` on a pointer type. +It is possible to control whether opaque pointers are used (if you want to +override the default) using the ``LLVMContextSetOpaquePointers()`` API. + Transition State ================