================
@@ -412,6 +412,15 @@ class AArch64Subtarget final : public 
AArch64GenSubtargetInfo {
   /// Choose a method of checking LR before performing a tail call.
   AArch64PAuth::AuthCheckMethod getAuthenticatedLRCheckMethod() const;
 
+  /// Compute the integer discriminator for a given BlockAddress constant, if
+  /// blockaddress signing is enabled (using function attribute
+  /// "ptrauth-indirect-gotos").
----------------
kovdan01 wrote:

Nit: it might be worth explicitly saying that `std::nullopt` return value 
stands for disabled indirect gotos signing: someone might mistakenly think that 
`std::nullopt` might indicate absent discriminator (say, zero discr by default) 
with signing enabled.

Alternatively, you might consider adding a separate function for determining 
presence of "ptrauth-indirect-gotos" attribute and use just `uint16_t` as a 
return value for `getPtrAuthBlockAddressDiscriminator` (with an assertion 
inserted against presence of "ptrauth-indirect-gotos"). A drawback of such 
approach is that we might occasionally forget to check if indirect gotos are 
signed before calling get discr function, but a benefit is that function names 
will be more expressive IMHO - `getPtrAuthBlockAddressDiscriminator` will only 
get the discriminator and it'll not have a responsibility to check if the 
signing is enabled.

Feel free to ignore.

https://github.com/llvm/llvm-project/pull/97647
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to