Skip to content

Commit 42c1619

Browse files
committed
[GSB] Eliminate a debugging-only source of potential archetype realization.
1 parent 972f048 commit 42c1619

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/swift/AST/GenericSignatureBuilder.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,17 +1546,16 @@ class GenericSignatureBuilder::PotentialArchetype {
15461546
/// path compression on the way.
15471547
PotentialArchetype *getRepresentative() const;
15481548

1549+
private:
15491550
/// Retrieve the generic signature builder with which this archetype is
15501551
/// associated.
1551-
/// FIXME: Only EquivalenceClassVizIterator gets to use this.
15521552
GenericSignatureBuilder *getBuilder() const {
15531553
const PotentialArchetype *pa = this;
15541554
while (auto parent = pa->getParent())
15551555
pa = parent;
15561556
return pa->parentOrBuilder.get<GenericSignatureBuilder *>();
15571557
}
15581558

1559-
private:
15601559
// Replace the generic signature builder.
15611560
void replaceBuilder(GenericSignatureBuilder *builder) {
15621561
assert(parentOrBuilder.is<GenericSignatureBuilder *>());

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ static int compareDependentTypes(PotentialArchetype * const* pa,
200200
return compareDependentTypes(pa, pb, /*outermost=*/true);
201201
}
202202

203+
static int compareDependentTypes(Type type1, Type type2,
204+
bool outermost = true);
205+
203206
namespace {
204207
/// A node in the equivalence class, used for visualization.
205208
struct EquivalenceClassVizNode {
@@ -220,10 +223,8 @@ namespace {
220223

221224
void advance() {
222225
while (base != baseEnd) {
223-
// FIXME: Only legitimate current use of getBuilder().
224-
auto subjectPA =
225-
base->realizeSubjectPotentialArchetype(*base->value->getBuilder());
226-
if (compareDependentTypes(&subjectPA, &base->value) <= 0)
226+
if (compareDependentTypes(base->getSubjectDependentType(),
227+
base->value->getDependentType({ })) <= 0)
227228
break;
228229

229230
++base;
@@ -2428,7 +2429,7 @@ static bool hasConcreteDecls(const PotentialArchetype *pa) {
24282429

24292430
/// Canonical ordering for dependent types.
24302431
static int compareDependentTypes(Type type1, Type type2,
2431-
bool outermost = true) {
2432+
bool outermost) {
24322433
// Fast-path check for equality.
24332434
if (type1->isEqual(type2)) return 0;
24342435

0 commit comments

Comments
 (0)