@@ -821,6 +821,12 @@ class alignas(1 << TypeAlignInBits) TypeBase
821821 // / type variables referenced by this type.
822822 void getTypeVariables (SmallPtrSetImpl<TypeVariableType *> &typeVariables);
823823
824+ private:
825+ // / If the receiver is a `DependentMemberType`, returns its root. Otherwise,
826+ // / returns the receiver.
827+ Type getDependentMemberRoot ();
828+
829+ public:
824830 // / Determine whether this type is a type parameter, which is either a
825831 // / GenericTypeParamType or a DependentMemberType.
826832 // /
@@ -6970,8 +6976,6 @@ class OpenedArchetypeType final : public LocalArchetypeType,
69706976 friend ArchetypeType;
69716977 friend GenericEnvironment;
69726978
6973- UUID ID;
6974-
69756979 // / Create a new opened archetype in the given environment representing
69766980 // / the interface type.
69776981 // /
@@ -6987,10 +6991,7 @@ class OpenedArchetypeType final : public LocalArchetypeType,
69876991 // / of an existential value.
69886992 // /
69896993 // / \param existential The existential type to open.
6990- // / \param knownID When non-empty, the known ID of the archetype. When empty,
6991- // / a fresh archetype with a unique ID will be opened.
6992- static CanTypeWrapper<OpenedArchetypeType>
6993- get (CanType existential, std::optional<UUID> knownID = std::nullopt );
6994+ static CanTypeWrapper<OpenedArchetypeType> get (CanType existential);
69946995
69956996 // / Create a new archetype that represents the opened type
69966997 // / of an existential value.
@@ -7065,8 +7066,6 @@ class ElementArchetypeType final : public LocalArchetypeType,
70657066 friend ArchetypeType;
70667067 friend GenericEnvironment;
70677068
7068- UUID ID;
7069-
70707069 // / Create a new element archetype in the given environment representing
70717070 // / the interface type.
70727071 // /
@@ -7862,38 +7861,11 @@ inline ASTContext &TypeBase::getASTContext() const {
78627861 return *const_cast <ASTContext*>(getCanonicalType ()->Context );
78637862}
78647863
7865- inline bool TypeBase::isTypeVariableOrMember () {
7866- Type t (this );
7867-
7868- while (auto *memberTy = t->getAs <DependentMemberType>())
7869- t = memberTy->getBase ();
7870-
7871- return t->is <TypeVariableType>();
7872- }
7873-
7874- inline bool TypeBase::isTypeParameter () {
7875- Type t (this );
7876-
7877- while (auto *memberTy = t->getAs <DependentMemberType>())
7878- t = memberTy->getBase ();
7879-
7880- return t->is <GenericTypeParamType>();
7881- }
7882-
78837864// TODO: This will become redundant once InOutType is removed.
78847865inline bool TypeBase::isMaterializable () {
78857866 return !(hasLValueType () || is<InOutType>());
78867867}
78877868
7888- inline GenericTypeParamType *TypeBase::getRootGenericParam () {
7889- Type t (this );
7890-
7891- while (auto *memberTy = t->getAs <DependentMemberType>())
7892- t = memberTy->getBase ();
7893-
7894- return t->castTo <GenericTypeParamType>();
7895- }
7896-
78977869inline bool TypeBase::isConstraintType () const {
78987870 return getCanonicalType ().isConstraintType ();
78997871}
0 commit comments