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> {
12951295 assert (isTypeMetadata ());
12961296 }
12971297
1298+ bool isCanonicalStaticallySpecializedGenericMetadata () const {
1299+ auto *description = getDescription ();
1300+ if (!description->isGeneric ())
1301+ return false ;
1302+
1303+ return this ->Flags & ClassFlags::IsCanonicalStaticSpecialization;
1304+ }
1305+
12981306 static bool classof (const TargetMetadata<Runtime> *metadata) {
12991307 return metadata->getKind () == MetadataKind::Class;
13001308 }
Original file line number Diff line number Diff line change @@ -265,7 +265,16 @@ enum class ClassFlags : uint32_t {
265265 UsesSwiftRefcounting = 0x2 ,
266266
267267 // / 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 ,
269278};
270279inline bool operator &(ClassFlags a, ClassFlags b) {
271280 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 {
55125512 return metadata->isCanonicalStaticallySpecializedGenericMetadata ();
55135513 if (auto *metadata = dyn_cast<EnumMetadata>(this ))
55145514 return metadata->isCanonicalStaticallySpecializedGenericMetadata ();
5515+ if (auto *metadata = dyn_cast<ClassMetadata>(this ))
5516+ return metadata->isCanonicalStaticallySpecializedGenericMetadata ();
55155517
55165518 return false ;
55175519}
You can’t perform that action at this time.
0 commit comments