@@ -5504,53 +5504,6 @@ static void collapseSameTypeComponentsThroughDelayedRequirements(
5504
5504
collapsedParents.end ());
5505
5505
}
5506
5506
5507
- // / Check whether two potential archetypes "structurally" match, e.g.,
5508
- // / the names match up to the root (which must match).
5509
- static bool potentialArchetypesStructurallyMatch (PotentialArchetype *pa1,
5510
- PotentialArchetype *pa2) {
5511
- auto parent1 = pa1->getParent ();
5512
- auto parent2 = pa2->getParent ();
5513
- if (!parent1 && !parent2)
5514
- return pa1->getGenericParamKey () == pa2->getGenericParamKey ();
5515
-
5516
- // Check for depth mismatch.
5517
- if (static_cast <bool >(parent1) != static_cast <bool >(parent2))
5518
- return false ;
5519
-
5520
- // Check names.
5521
- if (pa1->getNestedName () != pa2->getNestedName ())
5522
- return false ;
5523
-
5524
- return potentialArchetypesStructurallyMatch (parent1, parent2);
5525
- }
5526
-
5527
- // / Look for structurally-equivalent types within the given equivalence class,
5528
- // / collapsing their components.
5529
- static void collapseStructurallyEquivalentSameTypeComponents (
5530
- EquivalenceClass *equivClass,
5531
- llvm::SmallDenseMap<PotentialArchetype *, unsigned > &componentOf,
5532
- SmallVectorImpl<unsigned > &collapsedParents,
5533
- unsigned &remainingComponents) {
5534
- for (unsigned i : indices (equivClass->members )) {
5535
- auto pa1 = equivClass->members [i];
5536
- auto rep1 = findRepresentative (collapsedParents, componentOf[pa1]);
5537
- for (unsigned j : indices (equivClass->members ).slice (i + 1 )) {
5538
- auto pa2 = equivClass->members [j];
5539
- auto rep2 = findRepresentative (collapsedParents, componentOf[pa2]);
5540
- if (rep1 == rep2) continue ;
5541
-
5542
- auto depth = pa1->getNestingDepth ();
5543
- if (depth < 2 || depth != pa2->getNestingDepth ()) continue ;
5544
-
5545
- if (potentialArchetypesStructurallyMatch (pa1, pa2) &&
5546
- unionSets (collapsedParents, rep1, rep2)) {
5547
- --remainingComponents;
5548
- rep1 = findRepresentative (collapsedParents, componentOf[pa1]);
5549
- }
5550
- }
5551
- }
5552
- }
5553
-
5554
5507
// / Collapse same-type components within an equivalence class, minimizing the
5555
5508
// / number of requirements required to express the equivalence class.
5556
5509
static void collapseSameTypeComponents (
@@ -5611,14 +5564,6 @@ static void collapseSameTypeComponents(
5611
5564
builder, equivClass, componentOf, collapsedParents, remainingComponents);
5612
5565
}
5613
5566
5614
- if (remainingComponents > 1 ) {
5615
- // Collapse structurally-equivalent components.
5616
- collapseStructurallyEquivalentSameTypeComponents (equivClass,
5617
- componentOf,
5618
- collapsedParents,
5619
- remainingComponents);
5620
- }
5621
-
5622
5567
// If needed, collapse the same-type components merged by a derived
5623
5568
// nested-type-name-match edge.
5624
5569
unsigned maxComponents = equivClass->derivedSameTypeComponents .size ();
0 commit comments