[llvm-branch-commits] [clang] [llvm] [clang] Define ptrauth_string_discriminator builtin. (PR #93903)
Daniil Kovalev via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jun 10 06:04:07 PDT 2024
================
@@ -328,6 +328,21 @@ be done in a single instruction with an immediate integer.
``pointer`` must have pointer type, and ``integer`` must have integer type. The
result has type ``ptrauth_extra_data_t``.
+``ptrauth_string_discriminator``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: c
+
+ ptrauth_string_discriminator(string)
+
+Produce a discriminator value for the given string. ``string`` must be
+a string literal of ``char`` character type. The result has type
+``ptrauth_extra_data_t``.
+
+The result is always a constant expression. The result value is never zero and
+always within range for both the ``__ptrauth`` qualifier and
----------------
kovdan01 wrote:
Since we are talking about ranges here, it would be nice to have these ranges explicitly described in corresponding parts of docs. As far as I understand, different implementations are allowed to have different constraints on discriminator. It would be nice to somewhere describe actual figures for some specific implementation, e.g. arm64e. Please let me know if there is already a place for that which I've missed.
https://github.com/llvm/llvm-project/pull/93903
More information about the llvm-branch-commits
mailing list