Skip to content

Commit

Permalink
Update types documentation for IR layer typed pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
gmarkall committed Feb 28, 2025
1 parent be48e7b commit eca2f5e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions docs/source/user-guide/ir/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ Atomic types
Pointer Types
=============

llvmlite presently supports both *Typed Pointers* and *Opaque Pointers*. Typed
Pointers are currently the default; Opaque Pointers will become the default in
future, and support for Typed Pointers will be eventually be removed.
The IR layer presently supports both *Typed Pointers* and *Opaque Pointers*.
Typed Pointers are currently the default; Opaque Pointers will become the
default in future, and support for Typed Pointers will be eventually be
removed.

.. note::
Further details of the migration to Opaque Pointers are outlined in the
Expand All @@ -126,23 +127,25 @@ When Typed Pointers are enabled, the pointer type is represented using:

The type pointed to.

Opaque pointers can be enabled by setting the environment variable:
Opaque Pointers can be enabled in the IR layer by setting the environment
variable:

.. code:: bash
LLVMLITE_ENABLE_OPAQUE_POINTERS=1
LLVMLITE_ENABLE_IR_LAYER_TYPED_POINTERS=0
or by setting the ``opaque_pointers_enabled`` attribute after importing
or by setting the ``ir_layer_typed_pointers_enabled`` attribute after importing
llvmlite, but prior to using any of its functionality. For example:

.. code:: python
import llvmlite
llvmlite.opaque_pointers_enabled = True
llvmlite.ir_layer_typed_pointers_enabled = False
# ... continue using llvmlite ...
When Opaque Pointers are enabled, the pointer type is represented using:
When Opaque Pointers are enabled (by disabling Typed Pointers), the pointer
type is represented using:

.. class:: PointerType(addrspace=0)
:no-index:
Expand Down

0 comments on commit eca2f5e

Please sign in to comment.