@@ -821,6 +821,12 @@ class alignas(1 << TypeAlignInBits) TypeBase
821
821
// / type variables referenced by this type.
822
822
void getTypeVariables (SmallPtrSetImpl<TypeVariableType *> &typeVariables);
823
823
824
+ private:
825
+ // / If the receiver is a `DependentMemberType`, returns its root. Otherwise,
826
+ // / returns the receiver.
827
+ Type getDependentMemberRoot ();
828
+
829
+ public:
824
830
// / Determine whether this type is a type parameter, which is either a
825
831
// / GenericTypeParamType or a DependentMemberType.
826
832
// /
@@ -6970,8 +6976,6 @@ class OpenedArchetypeType final : public LocalArchetypeType,
6970
6976
friend ArchetypeType;
6971
6977
friend GenericEnvironment;
6972
6978
6973
- UUID ID;
6974
-
6975
6979
// / Create a new opened archetype in the given environment representing
6976
6980
// / the interface type.
6977
6981
// /
@@ -6987,10 +6991,7 @@ class OpenedArchetypeType final : public LocalArchetypeType,
6987
6991
// / of an existential value.
6988
6992
// /
6989
6993
// / \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);
6994
6995
6995
6996
// / Create a new archetype that represents the opened type
6996
6997
// / of an existential value.
@@ -7065,8 +7066,6 @@ class ElementArchetypeType final : public LocalArchetypeType,
7065
7066
friend ArchetypeType;
7066
7067
friend GenericEnvironment;
7067
7068
7068
- UUID ID;
7069
-
7070
7069
// / Create a new element archetype in the given environment representing
7071
7070
// / the interface type.
7072
7071
// /
@@ -7862,38 +7861,11 @@ inline ASTContext &TypeBase::getASTContext() const {
7862
7861
return *const_cast <ASTContext*>(getCanonicalType ()->Context );
7863
7862
}
7864
7863
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
-
7883
7864
// TODO: This will become redundant once InOutType is removed.
7884
7865
inline bool TypeBase::isMaterializable () {
7885
7866
return !(hasLValueType () || is<InOutType>());
7886
7867
}
7887
7868
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
-
7897
7869
inline bool TypeBase::isConstraintType () const {
7898
7870
return getCanonicalType ().isConstraintType ();
7899
7871
}
0 commit comments