@@ -5419,20 +5419,13 @@ DependentMemberType *DependentMemberType::get(Type base,
54195419 return known;
54205420}
54215421
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-
54315422OpaqueTypeArchetypeType *OpaqueTypeArchetypeType::getNew (
54325423 GenericEnvironment *environment, Type interfaceType,
54335424 ArrayRef<ProtocolDecl *> conformsTo, Type superclass,
54345425 LayoutConstraint layout) {
5435- auto properties = getOpaqueTypeArchetypeProperties (
5426+ auto properties = archetypeProperties (
5427+ RecursiveTypeProperties::HasOpaqueArchetype,
5428+ conformsTo, superclass,
54365429 environment->getOuterSubstitutions ());
54375430 auto arena = getArena (properties);
54385431 auto size = OpaqueTypeArchetypeType::totalSizeToAlloc<
@@ -5451,19 +5444,12 @@ Type OpaqueTypeArchetypeType::get(
54515444 return env->getOrCreateArchetypeFromInterfaceType (interfaceType);
54525445}
54535446
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-
54625447CanTypeWrapper<OpenedArchetypeType> OpenedArchetypeType::getNew (
54635448 GenericEnvironment *environment, Type interfaceType,
54645449 ArrayRef<ProtocolDecl *> conformsTo, Type superclass,
54655450 LayoutConstraint layout) {
5466- auto properties = getOpenedArchetypeProperties (
5451+ auto properties = archetypeProperties (
5452+ RecursiveTypeProperties::HasOpenedExistential, conformsTo, superclass,
54675453 environment->getOuterSubstitutions ());
54685454 auto arena = getArena (properties);
54695455 auto size = OpenedArchetypeType::totalSizeToAlloc<
@@ -5658,7 +5644,8 @@ GenericEnvironment *GenericEnvironment::forOpaqueType(
56585644
56595645 auto &ctx = opaque->getASTContext ();
56605646
5661- auto properties = getOpaqueTypeArchetypeProperties (subs);
5647+ auto properties = ArchetypeType::archetypeProperties (
5648+ RecursiveTypeProperties::HasOpaqueArchetype, { }, Type (), subs);
56625649 auto arena = getArena (properties);
56635650 auto &environments
56645651 = ctx.getImpl ().getArena (arena).OpaqueArchetypeEnvironments ;
@@ -5706,7 +5693,11 @@ GenericEnvironment::forOpenedExistential(
57065693
57075694 auto &ctx = existential->getASTContext ();
57085695
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+
57105701 auto arena = getArena (properties);
57115702
57125703 auto key = std::make_pair (subs, uuid);
0 commit comments