================
@@ -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)                    
\
----------------
kovdan01 wrote:

Nit: it's very subjective, but I find the naming a bit misleading. When I first 
read this, I though that this unconditionally defines a discriminator which is 
dependent on function type, while the discriminator is either type-based or 
constant zero depending on `ptrauth_function_pointer_type_discrimination` 
feature.

Maybe we can just avoid the word "type" in macro name, like 
`ptrauth_function_pointer_discriminator`. Or think of other alternatives in 
naming.

Feel free to ignore.

https://github.com/llvm/llvm-project/pull/161027
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to