@@ -168,7 +168,10 @@ class RecursiveTypeProperties {
168
168
// / This type contains a parameterized existential type \c any P<T>.
169
169
HasParameterizedExistential = 0x2000 ,
170
170
171
- Last_Property = HasParameterizedExistential
171
+ // / This type contains an ElementArchetype.
172
+ HasElementArchetype = 0x4000 ,
173
+
174
+ Last_Property = HasElementArchetype
172
175
};
173
176
enum { BitWidth = countBitsUsed (Property::Last_Property) };
174
177
@@ -212,9 +215,19 @@ class RecursiveTypeProperties {
212
215
bool hasDependentMember () const { return Bits & HasDependentMember; }
213
216
214
217
// / Does a type with these properties structurally contain an
215
- // / archetype?
218
+ // / opened existential archetype?
216
219
bool hasOpenedExistential () const { return Bits & HasOpenedExistential; }
217
220
221
+ // / Does a type with these properties structurally contain an
222
+ // / opened element archetype?
223
+ bool hasElementArchetype () const { return Bits & HasElementArchetype; }
224
+
225
+ // / Does a type with these properties structurally contain a local
226
+ // / archetype?
227
+ bool hasLocalArchetype () const {
228
+ return hasOpenedExistential () || hasElementArchetype ();
229
+ }
230
+
218
231
// / Does a type with these properties structurally contain a
219
232
// / reference to DynamicSelf?
220
233
bool hasDynamicSelf () const { return Bits & HasDynamicSelf; }
@@ -629,6 +642,16 @@ class alignas(1 << TypeAlignInBits) TypeBase
629
642
return getRecursiveProperties ().hasOpenedExistential ();
630
643
}
631
644
645
+ // / Determine whether the type involves an opened element archetype.
646
+ bool hasElementArchetype () const {
647
+ return getRecursiveProperties ().hasElementArchetype ();
648
+ }
649
+
650
+ // / Determine whether the type involves a local archetype.
651
+ bool hasLocalArchetype () const {
652
+ return getRecursiveProperties ().hasLocalArchetype ();
653
+ }
654
+
632
655
bool hasParameterPack () const {
633
656
return getRecursiveProperties ().hasParameterPack ();
634
657
}
0 commit comments