[clang] [clang][PAC][NFC] Provide addition support macros to ptrauth.h (PR #161027)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 20 21:52:48 PDT 2025


================
@@ -241,6 +260,18 @@ typedef __UINTPTR_TYPE__ ptrauth_generic_signature_t;
 #define ptrauth_type_discriminator(__type)                                     \
   __builtin_ptrauth_type_discriminator(__type)
 
+/* Compute the constant discriminator used by Clang to sign pointers with the
+   given C function pointer type.
+
+   A call to this function is an integer constant expression. */
+#if __has_feature(ptrauth_function_pointer_type_discrimination)
+#define ptrauth_function_pointer_type_discriminator(__type)                    \
----------------
ojhunt wrote:

it's kind of awkwardly named, but is used extensively :-/

https://github.com/llvm/llvm-project/pull/161027


More information about the cfe-commits mailing list