@@ -90,13 +90,6 @@ struct GenericSignatureBuilder::Implementation {
90
90
// / The set of requirements that have been delayed for some reason.
91
91
SmallVector<DelayedRequirement, 4 > DelayedRequirements;
92
92
93
- // / The generation number, which is incremented whenever we successfully
94
- // / introduce a new constraint.
95
- unsigned Generation = 0 ;
96
-
97
- // / The generation at which we last processed all of the delayed requirements.
98
- unsigned LastProcessedGeneration = 0 ;
99
-
100
93
#ifndef NDEBUG
101
94
// / Whether we've already finalized the builder.
102
95
bool finalized = false ;
@@ -1406,9 +1399,6 @@ bool PotentialArchetype::addConformance(ProtocolDecl *proto,
1406
1399
return false ;
1407
1400
}
1408
1401
1409
- // Bump the generation.
1410
- ++builder.Impl ->Generation ;
1411
-
1412
1402
// Add the conformance along with this constraint.
1413
1403
equivClass->conformsTo [proto].push_back ({this , proto, source});
1414
1404
++NumConformanceConstraints;
@@ -1876,12 +1866,6 @@ PotentialArchetype *PotentialArchetype::updateNestedTypeForConformance(
1876
1866
if (!assocType && !concreteDecl)
1877
1867
return nullptr ;
1878
1868
1879
- // If we were asked for a complete, well-formed archetype, make sure we
1880
- // process delayed requirements if anything changed.
1881
- SWIFT_DEFER {
1882
- getBuilder ()->processDelayedRequirements ();
1883
- };
1884
-
1885
1869
Identifier name = assocType ? assocType->getName () : concreteDecl->getName ();
1886
1870
ProtocolDecl *proto =
1887
1871
assocType ? assocType->getProtocol ()
@@ -1916,9 +1900,6 @@ PotentialArchetype *PotentialArchetype::updateNestedTypeForConformance(
1916
1900
switch (kind) {
1917
1901
case ArchetypeResolutionKind::CompleteWellFormed:
1918
1902
case ArchetypeResolutionKind::WellFormed: {
1919
- // Bump the generation count, because we created a new archetype.
1920
- ++getBuilder ()->Impl ->Generation ;
1921
-
1922
1903
if (assocType)
1923
1904
resultPA = new PotentialArchetype (this , assocType);
1924
1905
else
@@ -2837,9 +2818,6 @@ ConstraintResult GenericSignatureBuilder::addLayoutRequirement(
2837
2818
return ConstraintResult::Resolved;
2838
2819
}
2839
2820
2840
- // Bump the generation.
2841
- ++Impl->Generation ;
2842
-
2843
2821
auto pa = resolvedSubject->getPotentialArchetype ();
2844
2822
return addLayoutRequirementDirect (pa, layout, source.getSource (pa));
2845
2823
}
@@ -2924,9 +2902,6 @@ ConstraintResult GenericSignatureBuilder::addSuperclassRequirementDirect(
2924
2902
.push_back (ConcreteConstraint{T, superclass, source});
2925
2903
++NumSuperclassConstraints;
2926
2904
2927
- // Bump the generation.
2928
- ++Impl->Generation ;
2929
-
2930
2905
// Update the equivalence class with the constraint.
2931
2906
updateSuperclass (T, superclass, source);
2932
2907
return ConstraintResult::Resolved;
@@ -3086,9 +3061,6 @@ GenericSignatureBuilder::addSameTypeRequirementBetweenArchetypes(
3086
3061
if (T1 == T2)
3087
3062
return ConstraintResult::Resolved;
3088
3063
3089
- // Bump the generation.
3090
- ++Impl->Generation ;
3091
-
3092
3064
unsigned nestingDepth1 = T1->getNestingDepth ();
3093
3065
unsigned nestingDepth2 = T2->getNestingDepth ();
3094
3066
@@ -3224,9 +3196,6 @@ ConstraintResult GenericSignatureBuilder::addSameTypeRequirementToConcrete(
3224
3196
ConcreteConstraint{T, Concrete, Source});
3225
3197
++NumConcreteTypeConstraints;
3226
3198
3227
- // Bump the generation.
3228
- ++Impl->Generation ;
3229
-
3230
3199
// If we've already been bound to a type, match that type.
3231
3200
if (equivClass->concreteType ) {
3232
3201
return addSameTypeRequirement (equivClass->concreteType , Concrete, Source,
@@ -4009,13 +3978,6 @@ static GenericSignatureBuilder::UnresolvedType asUnresolvedType(
4009
3978
}
4010
3979
4011
3980
void GenericSignatureBuilder::processDelayedRequirements () {
4012
- // If we're already up-to-date, do nothing.
4013
- if (Impl->Generation == Impl->LastProcessedGeneration ) return ;
4014
-
4015
- SWIFT_DEFER {
4016
- Impl->LastProcessedGeneration = Impl->Generation ;
4017
- };
4018
-
4019
3981
bool anySolved = !Impl->DelayedRequirements .empty ();
4020
3982
while (anySolved) {
4021
3983
// Steal the delayed requirements so we can reprocess them.
0 commit comments