@@ -1478,8 +1478,8 @@ struct GenericSignatureBuilder::Constraint {
1478
1478
1479
1479
class GenericSignatureBuilder ::PotentialArchetype {
1480
1480
// / The parent of this potential archetype (for a nested type) or the
1481
- // / generic signature builder in which this root resides.
1482
- llvm::PointerUnion<PotentialArchetype*, GenericSignatureBuilder *> parentOrBuilder ;
1481
+ // / ASTContext in which the potential archetype resides.
1482
+ llvm::PointerUnion<PotentialArchetype*, ASTContext *> parentOrContext ;
1483
1483
1484
1484
// / The identifier describing this particular archetype.
1485
1485
// /
@@ -1545,17 +1545,16 @@ class GenericSignatureBuilder::PotentialArchetype {
1545
1545
1546
1546
// / \brief Construct a new potential archetype for a concrete declaration.
1547
1547
PotentialArchetype (PotentialArchetype *parent, TypeDecl *concreteDecl)
1548
- : parentOrBuilder (parent), identifier(concreteDecl)
1548
+ : parentOrContext (parent), identifier(concreteDecl)
1549
1549
{
1550
1550
assert (parent != nullptr && " Not a nested type?" );
1551
1551
assert (!isa<AssociatedTypeDecl>(concreteDecl) ||
1552
1552
cast<AssociatedTypeDecl>(concreteDecl)->getOverriddenDecls ().empty ());
1553
1553
}
1554
1554
1555
1555
// / \brief Construct a new potential archetype for a generic parameter.
1556
- PotentialArchetype (GenericSignatureBuilder *builder,
1557
- GenericParamKey genericParam)
1558
- : parentOrBuilder(builder), identifier(genericParam)
1556
+ PotentialArchetype (ASTContext &ctx, GenericParamKey genericParam)
1557
+ : parentOrContext(&ctx), identifier(genericParam)
1559
1558
{
1560
1559
}
1561
1560
@@ -1564,13 +1563,6 @@ class GenericSignatureBuilder::PotentialArchetype {
1564
1563
// / path compression on the way.
1565
1564
PotentialArchetype *getRepresentative () const ;
1566
1565
1567
- private:
1568
- // Replace the generic signature builder.
1569
- void replaceBuilder (GenericSignatureBuilder *builder) {
1570
- assert (parentOrBuilder.is <GenericSignatureBuilder *>());
1571
- parentOrBuilder = builder;
1572
- }
1573
-
1574
1566
friend class GenericSignatureBuilder ;
1575
1567
friend class GenericSignature ;
1576
1568
@@ -1583,7 +1575,7 @@ class GenericSignatureBuilder::PotentialArchetype {
1583
1575
// / Retrieve the parent of this potential archetype, which will be non-null
1584
1576
// / when this potential archetype is an associated type.
1585
1577
PotentialArchetype *getParent () const {
1586
- return parentOrBuilder .dyn_cast <PotentialArchetype *>();
1578
+ return parentOrContext .dyn_cast <PotentialArchetype *>();
1587
1579
}
1588
1580
1589
1581
// / Retrieve the type declaration to which this nested type was resolved.
@@ -1601,7 +1593,7 @@ class GenericSignatureBuilder::PotentialArchetype {
1601
1593
1602
1594
// / Determine whether this is a generic parameter.
1603
1595
bool isGenericParam () const {
1604
- return parentOrBuilder .is <GenericSignatureBuilder *>();
1596
+ return parentOrContext .is <ASTContext *>();
1605
1597
}
1606
1598
1607
1599
// / Retrieve the generic parameter key for a potential archetype that
0 commit comments