================
@@ -92,10 +91,26 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT,
          VTable->getValueType(), VTable, Idxs, /*InBounds=*/true, InRange);
 
      if (const auto &Schema =
-             CGM.getCodeGenOpts().PointerAuth.CXXVTTVTablePointers)
-       Init = CGM.getConstantSignedPointer(Init, Schema, nullptr, GlobalDecl(),
-                                           QualType());
-
+             CGM.getCodeGenOpts().PointerAuth.CXXVTTVTablePointers) {
+       llvm::Constant *AddressDesc =
+           Schema.isAddressDiscriminated()
+               ? llvm::ConstantExpr::getGetElementPtr(
+                     VTT->getType(), VTT,
+                     llvm::ConstantInt::get(CGM.Int32Ty, Idx))
+               : nullptr;
+       if (Schema.getOtherDiscrimination() ==
----------------
ojhunt wrote:

I need to think about this a bit more - I feel there should be a way to do it 
more cleanly, but that might just be wishful thinking.

Mostly I would rather it shared the logic with the vtable method slots

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

Reply via email to