@@ -158,6 +158,10 @@ class GenericSignatureBuilder {
158
158
std::vector<Constraint<LayoutConstraint>> layoutConstraints;
159
159
160
160
// / The members of the equivalence class.
161
+ // /
162
+ // / This list of members is slightly ordered, in that the first
163
+ // / element always has a depth no greater than the depth of any other
164
+ // / member.
161
165
TinyPtrVector<PotentialArchetype *> members;
162
166
163
167
// / Describes a component within the graph of same-type constraints within
@@ -203,6 +207,9 @@ class GenericSignatureBuilder {
203
207
EquivalenceClass &operator =(const EquivalenceClass &) = delete ;
204
208
EquivalenceClass &operator =(EquivalenceClass &&) = delete ;
205
209
210
+ // / Add a new member to this equivalence class.
211
+ void addMember (PotentialArchetype *pa);
212
+
206
213
// / Record the conformance of this equivalence class to the given
207
214
// / protocol as found via the given requirement source.
208
215
// /
@@ -758,6 +765,11 @@ class GenericSignatureBuilder {
758
765
resolvePotentialArchetype (Type type,
759
766
ArchetypeResolutionKind resolutionKind);
760
767
768
+ // / \brief Try to resolvew the equivalence class of the given type.
769
+ ResolveResult maybeResolveEquivalenceClass (
770
+ Type type,
771
+ ArchetypeResolutionKind resolutionKind);
772
+
761
773
// / \brief Resolve the equivalence class for the given type parameter,
762
774
// / which provides information about that type.
763
775
// /
@@ -1593,42 +1605,13 @@ class GenericSignatureBuilder::PotentialArchetype {
1593
1605
return identifier.assocTypeOrConcrete ;
1594
1606
}
1595
1607
1596
- // / Retrieve the set of protocols to which this potential archetype
1597
- // / conforms.
1598
- SmallVector<ProtocolDecl *, 4 > getConformsTo () const {
1599
- SmallVector<ProtocolDecl *, 4 > result;
1600
-
1601
- if (auto equiv = getEquivalenceClassIfPresent ()) {
1602
- for (const auto &entry : equiv->conformsTo )
1603
- result.push_back (entry.first );
1604
- }
1605
-
1606
- return result;
1607
- }
1608
-
1609
1608
// / Add a conformance to this potential archetype.
1610
1609
// /
1611
1610
// / \returns true if the conformance was new, false if it already existed.
1612
1611
bool addConformance (ProtocolDecl *proto,
1613
1612
const RequirementSource *source,
1614
1613
GenericSignatureBuilder &builder);
1615
1614
1616
- // / Retrieve the superclass of this archetype.
1617
- Type getSuperclass () const {
1618
- if (auto equiv = getEquivalenceClassIfPresent ())
1619
- return equiv->superclass ;
1620
-
1621
- return nullptr ;
1622
- }
1623
-
1624
- // / Retrieve the layout constraint of this archetype.
1625
- LayoutConstraint getLayout () const {
1626
- if (auto equivClass = getEquivalenceClassIfPresent ())
1627
- return equivClass->layout ;
1628
-
1629
- return LayoutConstraint ();
1630
- }
1631
-
1632
1615
// / Retrieve the set of nested types.
1633
1616
const llvm::MapVector<Identifier, StoredNestedType> &getNestedTypes () const {
1634
1617
return NestedTypes;
@@ -1741,14 +1724,6 @@ class GenericSignatureBuilder::PotentialArchetype {
1741
1724
return false ;
1742
1725
}
1743
1726
1744
- // / Get the concrete type this potential archetype is constrained to.
1745
- Type getConcreteType () const {
1746
- if (auto equivClass = getEquivalenceClassIfPresent ())
1747
- return equivClass->concreteType ;
1748
-
1749
- return Type ();
1750
- }
1751
-
1752
1727
LLVM_ATTRIBUTE_DEPRECATED (
1753
1728
void dump () const ,
1754
1729
"only for use within the debugger");
0 commit comments