================ @@ -1056,12 +1056,18 @@ class ConstantPtrAuth final : public Constant { return !getAddrDiscriminator()->isNullValue(); } - /// A constant value for the address discriminator which has special - /// significance to ctors/dtors lowering. Regular address discrimination can't - /// be applied for them since uses of llvm.global_{c|d}tors are disallowed - /// (see Verifier::visitGlobalVariable) and we can't emit getelementptr - /// expressions referencing these special arrays. - enum { AddrDiscriminator_CtorsDtors = 1 }; + /// Constant values for the address discriminator which have special + /// significance to lowering in some contexts. + /// - For ctors/dtors, regular address discrimination can't + /// be applied for them since uses of llvm.global_{c|d}tors are disallowed + /// (see Verifier::visitGlobalVariable) and we can't emit getelementptr + /// expressions referencing these special arrays. + /// - For vtable pointers of std::type_info and classes derived from it, + /// we do not know the storage address when emitting ptrauth constant. ---------------- kovdan01 wrote:
> Would it work to wire the storage address through > `ItaniumRTTIBuilder::BuildVTablePointer` from `BuildTypeInfo` ? @ahmedbougacha I was unable to find a straight-forward way to do that, but I might be missing smth (and it might be even smth obvious). I would be glad to see more detailed suggestions if you have some better implementation in mind - I agree that having an actual address instead of a placeholder is much better. > Beyond that, for static ctors, as I mentioned before, I still don't think > this should have ptrauth at the IR level, but rather should be a backend > decision made when encoding the IR representation of "a list of static > ctors/dtors" to some object file format encoding thereof. That would avoid > needing this address discriminator placeholder dance here. But I suppose > that's a separate problem. This sounds nice, it's an interesting suggestion. Anyway, init/fini stuff is out of scope of this PR https://github.com/llvm/llvm-project/pull/102199 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits