@@ -215,15 +215,6 @@ class GenericSignatureBuilder {
215
215
// / a superclass requirement.
216
216
bool isConformanceSatisfiedBySuperclass (ProtocolDecl *proto) const ;
217
217
218
- // / Lookup a nested type with the given name within this equivalence
219
- // / class.
220
- // /
221
- // / \param otherConcreteTypes If non-null, will be filled in the all of the
222
- // / concrete types we found (other than the result) with the same name.
223
- TypeDecl *lookupNestedType (
224
- Identifier name,
225
- SmallVectorImpl<TypeDecl *> *otherConcreteTypes = nullptr );
226
-
227
218
// / Dump a debugging representation of this equivalence class.
228
219
void dump (llvm::raw_ostream &out) const ;
229
220
@@ -241,17 +232,6 @@ class GenericSignatureBuilder {
241
232
// / anchor was cached.
242
233
unsigned numMembers;
243
234
} archetypeAnchorCache;
244
-
245
- // / Describes a cached nested type.
246
- struct CachedNestedType {
247
- unsigned numConformancesPresent;
248
- CanType superclassPresent;
249
- llvm::TinyPtrVector<TypeDecl *> types;
250
- };
251
-
252
- // / Cached nested-type information, which contains the best declaration
253
- // / for a given name.
254
- llvm::SmallDenseMap<Identifier, CachedNestedType> nestedTypeNameCache;
255
235
};
256
236
257
237
friend class RequirementSource ;
@@ -542,6 +522,9 @@ class GenericSignatureBuilder {
542
522
// / \brief Add all of a generic signature's parameters and requirements.
543
523
void addGenericSignature (GenericSignature *sig);
544
524
525
+ // / \brief Build the generic signature.
526
+ GenericSignature *getGenericSignature ();
527
+
545
528
// / Infer requirements from the given type, recursively.
546
529
// /
547
530
// / This routine infers requirements from a type that occurs within the
@@ -575,13 +558,11 @@ class GenericSignatureBuilder {
575
558
// / \brief Finalize the set of requirements and compute the generic
576
559
// / signature.
577
560
// /
578
- // / After this point, one cannot introduce new requirements, and the
579
- // / generic signature builder no longer has valid state.
561
+ // / After this point, one cannot introduce new requirements.
580
562
GenericSignature *computeGenericSignature (
581
563
SourceLoc loc,
582
- bool allowConcreteGenericParams = false ) && ;
564
+ bool allowConcreteGenericParams = false );
583
565
584
- private:
585
566
// / Finalize the set of requirements, performing any remaining checking
586
567
// / required before generating archetypes.
587
568
// /
@@ -591,7 +572,6 @@ class GenericSignatureBuilder {
591
572
ArrayRef<GenericTypeParamType *> genericParams,
592
573
bool allowConcreteGenericParams=false );
593
574
594
- public:
595
575
// / Process any delayed requirements that can be handled now.
596
576
void processDelayedRequirements ();
597
577
@@ -1510,12 +1490,6 @@ class GenericSignatureBuilder::PotentialArchetype {
1510
1490
return parentOrBuilder.dyn_cast <PotentialArchetype *>();
1511
1491
}
1512
1492
1513
- // / Retrieve the type declaration to which this nested type was resolved.
1514
- TypeDecl *getResolvedType () const {
1515
- assert (getParent () && " Not an associated type" );
1516
- return identifier.assocTypeOrConcrete ;
1517
- }
1518
-
1519
1493
// / Retrieve the associated type to which this potential archetype
1520
1494
// / has been resolved.
1521
1495
AssociatedTypeDecl *getResolvedAssociatedType () const {
@@ -1658,8 +1632,13 @@ class GenericSignatureBuilder::PotentialArchetype {
1658
1632
ArchetypeResolutionKind kind,
1659
1633
GenericSignatureBuilder &builder);
1660
1634
1661
- // / \brief Retrieve (or create) a nested type with a known type.
1662
- PotentialArchetype *getNestedType (TypeDecl *type,
1635
+ // / \brief Retrieve (or create) a nested type with a known associated type.
1636
+ PotentialArchetype *getNestedType (AssociatedTypeDecl *assocType,
1637
+ GenericSignatureBuilder &builder);
1638
+
1639
+ // / \brief Retrieve (or create) a nested type with a known concrete type
1640
+ // / declaration.
1641
+ PotentialArchetype *getNestedType (TypeDecl *concreteDecl,
1663
1642
GenericSignatureBuilder &builder);
1664
1643
1665
1644
// / \brief Retrieve (or create) a nested type that is the current best
@@ -1679,8 +1658,8 @@ class GenericSignatureBuilder::PotentialArchetype {
1679
1658
// / type or typealias of the given protocol, unless the \c kind implies that
1680
1659
// / a potential archetype should not be created if it's missing.
1681
1660
PotentialArchetype *updateNestedTypeForConformance (
1682
- TypeDecl *type,
1683
- ArchetypeResolutionKind kind);
1661
+ PointerUnion<AssociatedTypeDecl *, TypeDecl *> type,
1662
+ ArchetypeResolutionKind kind);
1684
1663
1685
1664
// / Update the named nested type when we know this type conforms to the given
1686
1665
// / protocol.
0 commit comments