@@ -5419,20 +5419,13 @@ DependentMemberType *DependentMemberType::get(Type base,
5419
5419
return known;
5420
5420
}
5421
5421
5422
- // / Compute the recursive type properties of an opaque type archetype.
5423
- static RecursiveTypeProperties getOpaqueTypeArchetypeProperties (
5424
- SubstitutionMap subs) {
5425
- RecursiveTypeProperties properties =
5426
- RecursiveTypeProperties::HasOpaqueArchetype;
5427
- properties |= subs.getRecursiveProperties ();
5428
- return properties;
5429
- }
5430
-
5431
5422
OpaqueTypeArchetypeType *OpaqueTypeArchetypeType::getNew (
5432
5423
GenericEnvironment *environment, Type interfaceType,
5433
5424
ArrayRef<ProtocolDecl *> conformsTo, Type superclass,
5434
5425
LayoutConstraint layout) {
5435
- auto properties = getOpaqueTypeArchetypeProperties (
5426
+ auto properties = archetypeProperties (
5427
+ RecursiveTypeProperties::HasOpaqueArchetype,
5428
+ conformsTo, superclass,
5436
5429
environment->getOuterSubstitutions ());
5437
5430
auto arena = getArena (properties);
5438
5431
auto size = OpaqueTypeArchetypeType::totalSizeToAlloc<
@@ -5451,19 +5444,12 @@ Type OpaqueTypeArchetypeType::get(
5451
5444
return env->getOrCreateArchetypeFromInterfaceType (interfaceType);
5452
5445
}
5453
5446
5454
- // / Compute the recursive type properties of an opened existential archetype.
5455
- static RecursiveTypeProperties getOpenedArchetypeProperties (SubstitutionMap subs) {
5456
- RecursiveTypeProperties properties =
5457
- RecursiveTypeProperties::HasOpenedExistential;
5458
- properties |= subs.getRecursiveProperties ();
5459
- return properties;
5460
- }
5461
-
5462
5447
CanTypeWrapper<OpenedArchetypeType> OpenedArchetypeType::getNew (
5463
5448
GenericEnvironment *environment, Type interfaceType,
5464
5449
ArrayRef<ProtocolDecl *> conformsTo, Type superclass,
5465
5450
LayoutConstraint layout) {
5466
- auto properties = getOpenedArchetypeProperties (
5451
+ auto properties = archetypeProperties (
5452
+ RecursiveTypeProperties::HasOpenedExistential, conformsTo, superclass,
5467
5453
environment->getOuterSubstitutions ());
5468
5454
auto arena = getArena (properties);
5469
5455
auto size = OpenedArchetypeType::totalSizeToAlloc<
@@ -5658,7 +5644,8 @@ GenericEnvironment *GenericEnvironment::forOpaqueType(
5658
5644
5659
5645
auto &ctx = opaque->getASTContext ();
5660
5646
5661
- auto properties = getOpaqueTypeArchetypeProperties (subs);
5647
+ auto properties = ArchetypeType::archetypeProperties (
5648
+ RecursiveTypeProperties::HasOpaqueArchetype, { }, Type (), subs);
5662
5649
auto arena = getArena (properties);
5663
5650
auto &environments
5664
5651
= ctx.getImpl ().getArena (arena).OpaqueArchetypeEnvironments ;
@@ -5706,7 +5693,11 @@ GenericEnvironment::forOpenedExistential(
5706
5693
5707
5694
auto &ctx = existential->getASTContext ();
5708
5695
5709
- auto properties = getOpenedArchetypeProperties (subs);
5696
+ auto layout = existential->getExistentialLayout ();
5697
+ auto properties = ArchetypeType::archetypeProperties (
5698
+ RecursiveTypeProperties::HasOpenedExistential,
5699
+ layout.getProtocols (), layout.getSuperclass (), subs);
5700
+
5710
5701
auto arena = getArena (properties);
5711
5702
5712
5703
auto key = std::make_pair (subs, uuid);
0 commit comments