[clang] [llvm] [PAC] Fix address discrimination for type info vtable pointers (PR #102199)

Daniil Kovalev via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 16 12:08:37 PDT 2024


================
@@ -3955,9 +3955,23 @@ void ItaniumRTTIBuilder::BuildVTablePointer(const Type *Ty) {
                                                           VTable, Two);
   }
 
-  if (auto &Schema = CGM.getCodeGenOpts().PointerAuth.CXXTypeInfoVTablePointer)
-    VTable = CGM.getConstantSignedPointer(VTable, Schema, nullptr, GlobalDecl(),
-                                          QualType(Ty, 0));
+  if (const auto &Schema =
+          CGM.getCodeGenOpts().PointerAuth.CXXTypeInfoVTablePointer) {
+    llvm::PointerType *PtrTy = llvm::PointerType::get(
+        CGM.getLLVMContext(),
+        CGM.getModule().getDataLayout().getProgramAddressSpace());
+    llvm::Constant *StorageAddress =
----------------
kovdan01 wrote:

> I'd prefer this be structured rather than using ?:

The corresponding piece of code was deleted in the latest commit 0c20bcdf35f3c15024986da50cafb2a8c155e3cf, so probably the comment could be resolved.

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


More information about the cfe-commits mailing list