File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -1295,6 +1295,14 @@ struct TargetClassMetadata : public TargetAnyClassMetadata<Runtime> {
1295
1295
assert (isTypeMetadata ());
1296
1296
}
1297
1297
1298
+ bool isCanonicalStaticallySpecializedGenericMetadata () const {
1299
+ auto *description = getDescription ();
1300
+ if (!description->isGeneric ())
1301
+ return false ;
1302
+
1303
+ return this ->Flags & ClassFlags::IsCanonicalStaticSpecialization;
1304
+ }
1305
+
1298
1306
static bool classof (const TargetMetadata<Runtime> *metadata) {
1299
1307
return metadata->getKind () == MetadataKind::Class;
1300
1308
}
Original file line number Diff line number Diff line change @@ -265,7 +265,16 @@ enum class ClassFlags : uint32_t {
265
265
UsesSwiftRefcounting = 0x2 ,
266
266
267
267
// / Has this class a custom name, specified with the @objc attribute?
268
- HasCustomObjCName = 0x4
268
+ HasCustomObjCName = 0x4 ,
269
+
270
+ // / Whether this metadata is a specialization of a generic metadata pattern
271
+ // / which was created during compilation.
272
+ IsStaticSpecialization = 0x8 ,
273
+
274
+ // / Whether this metadata is a specialization of a generic metadata pattern
275
+ // / which was created during compilation and made to be canonical by
276
+ // / modifying the metadata accessor.
277
+ IsCanonicalStaticSpecialization = 0x10 ,
269
278
};
270
279
inline bool operator &(ClassFlags a, ClassFlags b) {
271
280
return (uint32_t (a) & uint32_t (b)) != 0 ;
Original file line number Diff line number Diff line change @@ -5512,6 +5512,8 @@ bool Metadata::isCanonicalStaticallySpecializedGenericMetadata() const {
5512
5512
return metadata->isCanonicalStaticallySpecializedGenericMetadata ();
5513
5513
if (auto *metadata = dyn_cast<EnumMetadata>(this ))
5514
5514
return metadata->isCanonicalStaticallySpecializedGenericMetadata ();
5515
+ if (auto *metadata = dyn_cast<ClassMetadata>(this ))
5516
+ return metadata->isCanonicalStaticallySpecializedGenericMetadata ();
5515
5517
5516
5518
return false ;
5517
5519
}
You can’t perform that action at this time.
0 commit comments