@@ -56,12 +56,24 @@ template <typename Runtime> struct TargetOpaqueMetadata;
5656template <typename Runtime> struct TargetValueMetadata ;
5757template <typename Runtime> struct TargetForeignClassMetadata ;
5858template <typename Runtime> struct TargetForeignReferenceTypeMetadata ;
59- template <typename Runtime> struct TargetContextDescriptor ;
60- template <typename Runtime> class TargetTypeContextDescriptor ;
61- template <typename Runtime> class TargetClassDescriptor ;
62- template <typename Runtime> class TargetValueTypeDescriptor ;
63- template <typename Runtime> class TargetEnumDescriptor ;
64- template <typename Runtime> class TargetStructDescriptor ;
59+ template <typename Runtime>
60+ struct swift_ptrauth_struct_context_descriptor (ContextDescriptor)
61+ TargetContextDescriptor;
62+ template <typename Runtime>
63+ class swift_ptrauth_struct_context_descriptor (TypeContextDescriptor)
64+ TargetTypeContextDescriptor;
65+ template <typename Runtime>
66+ class swift_ptrauth_struct_context_descriptor (ClassDescriptor)
67+ TargetClassDescriptor;
68+ template <typename Runtime>
69+ class swift_ptrauth_struct_context_descriptor (ValueTypeDescriptor)
70+ TargetValueTypeDescriptor;
71+ template <typename Runtime>
72+ class swift_ptrauth_struct_context_descriptor (EnumDescriptor)
73+ TargetEnumDescriptor;
74+ template <typename Runtime>
75+ class swift_ptrauth_struct_context_descriptor (StructDescriptor)
76+ TargetStructDescriptor;
6577template <typename Runtime> struct TargetGenericMetadataPattern ;
6678template <typename Runtime> struct TargetProtocolConformanceDescriptor ;
6779
@@ -1632,7 +1644,9 @@ TargetTupleTypeMetadata<Runtime>::getOffsetToNumElements() -> StoredSize {
16321644 return offsetof (TargetTupleTypeMetadata<Runtime>, NumElements);
16331645}
16341646
1635- template <typename Runtime> struct TargetProtocolDescriptor ;
1647+ template <typename Runtime>
1648+ struct swift_ptrauth_struct_context_descriptor (ProtocolDescriptor)
1649+ TargetProtocolDescriptor;
16361650
16371651// / A protocol requirement descriptor. This describes a single protocol
16381652// / requirement in a protocol descriptor. The index of the requirement in
@@ -1660,7 +1674,9 @@ struct TargetProtocolRequirement {
16601674
16611675using ProtocolRequirement = TargetProtocolRequirement<InProcess>;
16621676
1663- template <typename Runtime> struct TargetProtocolDescriptor ;
1677+ template <typename Runtime>
1678+ struct swift_ptrauth_struct_context_descriptor (ProtocolDescriptor)
1679+ TargetProtocolDescriptor;
16641680using ProtocolDescriptor = TargetProtocolDescriptor<InProcess>;
16651681
16661682template <template <typename Runtime> class ObjCInteropKind , unsigned PointerSize>
@@ -2803,12 +2819,14 @@ using ExternalProtocolConformanceDescriptor = TargetProtocolConformanceDescripto
28032819template <template <typename Runtime> class ObjCInteropKind , unsigned PointerSize>
28042820using ExternalProtocolConformanceRecord = TargetProtocolConformanceRecord<External<ObjCInteropKind<RuntimeTarget<PointerSize>>>>;
28052821
2806- template <typename Runtime>
2807- struct TargetModuleContextDescriptor ;
2822+ template <typename Runtime>
2823+ struct swift_ptrauth_struct_context_descriptor (ModuleContextDescriptor)
2824+ TargetModuleContextDescriptor;
28082825
28092826// / Base class for all context descriptors.
2810- template <typename Runtime>
2811- struct TargetContextDescriptor {
2827+ template <typename Runtime>
2828+ struct swift_ptrauth_struct_context_descriptor (ContextDescriptor)
2829+ TargetContextDescriptor {
28122830 // / Flags describing the context, including its kind and format version.
28132831 ContextDescriptorFlags Flags;
28142832
@@ -2864,8 +2882,9 @@ inline bool isCImportedModuleName(llvm::StringRef name) {
28642882}
28652883
28662884// / Descriptor for a module context.
2867- template <typename Runtime>
2868- struct TargetModuleContextDescriptor final : TargetContextDescriptor<Runtime> {
2885+ template <typename Runtime>
2886+ struct swift_ptrauth_struct_context_descriptor (ModuleContextDescriptor)
2887+ TargetModuleContextDescriptor final : TargetContextDescriptor<Runtime> {
28692888 // / The module name.
28702889 RelativeDirectPointer<const char , /* nullable*/ false > Name;
28712890
@@ -2905,8 +2924,9 @@ TargetContextDescriptor<Runtime>::getModuleContext() const {
29052924}
29062925
29072926// / Descriptor for an extension context.
2908- template <typename Runtime>
2909- struct TargetExtensionContextDescriptor final
2927+ template <typename Runtime>
2928+ struct swift_ptrauth_struct_context_descriptor (ExtensionContextDescriptor)
2929+ TargetExtensionContextDescriptor final
29102930 : TargetContextDescriptor<Runtime>,
29112931 TrailingGenericContextObjects<TargetExtensionContextDescriptor<Runtime>>
29122932{
@@ -2944,8 +2964,9 @@ struct TargetMangledContextName {
29442964 TargetRelativeDirectPointer<Runtime, const char , /* nullable*/ false > name;
29452965};
29462966
2947- template <typename Runtime>
2948- struct TargetAnonymousContextDescriptor final
2967+ template <typename Runtime>
2968+ struct swift_ptrauth_struct_context_descriptor (AnonymousContextDescriptor)
2969+ TargetAnonymousContextDescriptor final
29492970 : TargetContextDescriptor<Runtime>,
29502971 TrailingGenericContextObjects<TargetAnonymousContextDescriptor<Runtime>,
29512972 TargetGenericContextDescriptorHeader,
@@ -3025,8 +3046,9 @@ using ExternalAnonymousContextDescriptor = TargetAnonymousContextDescriptor<Exte
30253046// / Only Swift protocols are defined by a protocol descriptor, whereas
30263047// / Objective-C (including protocols defined in Swift as @objc) use the
30273048// / Objective-C protocol layout.
3028- template <typename Runtime>
3029- struct TargetProtocolDescriptor final
3049+ template <typename Runtime>
3050+ struct swift_ptrauth_struct_context_descriptor (ProtocolDescriptor)
3051+ TargetProtocolDescriptor final
30303052 : TargetContextDescriptor<Runtime>,
30313053 swift::ABI::TrailingObjects<
30323054 TargetProtocolDescriptor<Runtime>,
@@ -3114,11 +3136,12 @@ struct TargetProtocolDescriptor final
31143136 return cd->getKind () == ContextDescriptorKind::Protocol;
31153137 }
31163138};
3117-
3139+
31183140// / The descriptor for an opaque type.
31193141template <typename Runtime>
3120- struct TargetOpaqueTypeDescriptor final
3121- : TargetContextDescriptor<Runtime>,
3142+ struct swift_ptrauth_struct_context_descriptor (OpaqueTypeDescriptor)
3143+ TargetOpaqueTypeDescriptor final
3144+ : TargetContextDescriptor<Runtime>,
31223145 TrailingGenericContextObjects<TargetOpaqueTypeDescriptor<Runtime>,
31233146 TargetGenericContextDescriptorHeader,
31243147 RelativeDirectPointer<const char >>
@@ -3694,8 +3717,8 @@ struct TargetCanonicalSpecializedMetadatasCachingOnceToken {
36943717};
36953718
36963719template <typename Runtime>
3697- class TargetTypeContextDescriptor
3698- : public TargetContextDescriptor<Runtime> {
3720+ class swift_ptrauth_struct_context_descriptor (TypeContextDescriptor)
3721+ TargetTypeContextDescriptor : public TargetContextDescriptor<Runtime> {
36993722public:
37003723 // / The name of the type.
37013724 TargetRelativeDirectPointer<Runtime, const char , /* nullable*/ false > Name;
@@ -3917,7 +3940,8 @@ struct TargetObjCResilientClassStubInfo {
39173940};
39183941
39193942template <typename Runtime>
3920- class TargetClassDescriptor final
3943+ class swift_ptrauth_struct_context_descriptor (ClassDescriptor)
3944+ TargetClassDescriptor final
39213945 : public TargetTypeContextDescriptor<Runtime>,
39223946 public TrailingGenericContextObjects<TargetClassDescriptor<Runtime>,
39233947 TargetTypeGenericContextDescriptorHeader,
@@ -4307,8 +4331,8 @@ class TargetClassDescriptor final
43074331using ClassDescriptor = TargetClassDescriptor<InProcess>;
43084332
43094333template <typename Runtime>
4310- class TargetValueTypeDescriptor
4311- : public TargetTypeContextDescriptor<Runtime> {
4334+ class swift_ptrauth_struct_context_descriptor (ValueTypeDescriptor)
4335+ TargetValueTypeDescriptor : public TargetTypeContextDescriptor<Runtime>{
43124336public:
43134337 static bool classof (const TargetContextDescriptor<Runtime> *cd) {
43144338 return cd->getKind () == ContextDescriptorKind::Struct ||
@@ -4318,7 +4342,8 @@ class TargetValueTypeDescriptor
43184342using ValueTypeDescriptor = TargetValueTypeDescriptor<InProcess>;
43194343
43204344template <typename Runtime>
4321- class TargetStructDescriptor final
4345+ class swift_ptrauth_struct_context_descriptor (StructDescriptor)
4346+ TargetStructDescriptor final
43224347 : public TargetValueTypeDescriptor<Runtime>,
43234348 public TrailingGenericContextObjects<TargetStructDescriptor<Runtime>,
43244349 TargetTypeGenericContextDescriptorHeader,
@@ -4445,7 +4470,8 @@ class TargetStructDescriptor final
44454470using StructDescriptor = TargetStructDescriptor<InProcess>;
44464471
44474472template <typename Runtime>
4448- class TargetEnumDescriptor final
4473+ class swift_ptrauth_struct_context_descriptor (EnumDescriptor)
4474+ TargetEnumDescriptor final
44494475 : public TargetValueTypeDescriptor<Runtime>,
44504476 public TrailingGenericContextObjects<TargetEnumDescriptor<Runtime>,
44514477 TargetTypeGenericContextDescriptorHeader,
0 commit comments