================
@@ -2221,13 +2222,19 @@ llvm::Value
*ItaniumCXXABI::getVTableAddressPointInStructorWithVTT(
CGF.Builder.CreateAlignedLoad(CGF.GlobalsVoidPtrTy, VTT,
CGF.getPointerAlign());
- if (auto &Schema =
CGF.CGM.getCodeGenOpts().PointerAuth.CXXVTTVTablePointers) {
- CGPointerAuthInfo PointerAuth = CGF.EmitPointerAuthInfo(Schema, VTT,
- GlobalDecl(),
- QualType());
+ if (auto &Schema = CGM.getCodeGenOpts().PointerAuth.CXXVTTVTablePointers) {
+ llvm::ConstantInt *TypeDesc = nullptr;
+ if (Schema.getOtherDiscrimination() ==
+ PointerAuthSchema::Discrimination::Type)
+ TypeDesc = llvm::ConstantInt::get(
+ CGM.IntPtrTy,
+ CGM.getContext().getPointerAuthVTablePointerDiscriminator(
----------------
ojhunt wrote:
Sorry, I wasn't clear here, and you're correct that per vtable encoding would
indeed break things.
What I was actually trying to say was to semi-generalize the existing
`getPointerAuthVTablePointerDiscriminator` to provide discriminators for the
non-function primary base specific entries, e.g
```cpp
enum class VTableEnumWithGoodName { VTable, VTT, ... };
std::optional<PointerAuthQualifier> computeVTPointerAuthentication(const
CXXRecordDecl *ThisClass, VTableEnumWithGoodName SlotKind) {
...
Discriminator = Context.getPointerAuthVTablePointerDiscriminator(PrimaryBase,
SlotKind);
...
uint16_t getPointerAuthVTablePointerDiscriminator(const CXXRecordDecl *RD,
SlotKind) {
...
switch (SlotKind) {
case vtable: mangleCXXVTable(RD);
case vtt: mangleCXXVTT(RD);
...
}
```
Or something to that effect.
https://github.com/llvm/llvm-project/pull/205808
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits