[clang] [PAC][clang] Implement address/type discrimination for VTT vtable pointers (PR #205808)

Kristina Bessonova via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 21 05:54:39 PDT 2026


================
@@ -1514,9 +1514,9 @@ class ASTContext : public RefCountedBase<ASTContext> {
   QualType removeAddrSpaceQualType(QualType T) const;
 
   /// Return the "other" discriminator used for the pointer auth schema used for
-  /// vtable pointers in instances of the requested type.
+  /// vtable pointers using the given discriminator type.
   uint16_t getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD,
-                                                    bool IsVTTEntry = false);
+                                                    bool IsVTTEntry);
----------------
chbessonova wrote:

I thought about this and agree that enum would be more readable. But, I preferred a bool because this seems to be a very local implementation detail with only two values that I don't expect to grow or be reused in some other context. So, I'd prefer not to expose it through ASTContext.h. I think adding `/*IsVTTEntry=*/` where a plain true/false is used makes it sufficiently clear.

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


More information about the cfe-commits mailing list