diff options
Diffstat (limited to 'clang/docs/LanguageExtensions.rst')
| -rw-r--r-- | clang/docs/LanguageExtensions.rst | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/docs/LanguageExtensions.rst b/clang/docs/LanguageExtensions.rst index e1929740356e..73544826809c 100644 --- a/clang/docs/LanguageExtensions.rst +++ b/clang/docs/LanguageExtensions.rst @@ -3074,6 +3074,41 @@ following way: Query for this feature with ``__has_builtin(__builtin_offsetof)``. +``__builtin_get_vtable_pointer`` +-------------------------------- + +``__builtin_get_vtable_pointer`` loads and authenticates the primary vtable +pointer from an instance of a polymorphic C++ class. This builtin is needed +for directly loading the vtable pointer when on platforms using +:doc:`PointerAuthentication`. + +**Syntax**: + +.. code-block:: c++ + + __builtin_get_vtable_pointer(PolymorphicClass*) + +**Example of Use**: + +.. code-block:: c++ + + struct PolymorphicClass { + virtual ~PolymorphicClass(); + }; + + PolymorphicClass anInstance; + const void* vtablePointer = __builtin_get_vtable_pointer(&anInstance); + +**Description**: + +The ``__builtin_get_vtable_pointer`` builtin loads the primary vtable +pointer from a polymorphic C++ type. If the target platform authenticates +vtable pointers, this builtin will perform the authentication and produce +the underlying raw pointer. The object being queried must be polymorphic, +and so must also be a complete type. + +Query for this feature with ``__has_builtin(__builtin_get_vtable_pointer)``. + ``__builtin_call_with_static_chain`` ------------------------------------ |
