@@ -457,10 +457,6 @@ struct ASTContext::Implementation {
457
457
// / The single-parameter generic signature with no constraints, <T>.
458
458
CanGenericSignature SingleGenericParameterSignature;
459
459
460
- // / The existential signature <T : P> for each P.
461
- llvm::DenseMap<std::pair<CanType, const GenericSignatureImpl *>, CanGenericSignature>
462
- ExistentialSignatures;
463
-
464
460
// / The element signature for a generic signature, which contains a clone
465
461
// / of the context generic signature with new type parameters and requirements
466
462
// / for opened pack elements in the given shape equivalence class.
@@ -851,7 +847,6 @@ void ASTContext::Implementation::dump(llvm::raw_ostream &os) const {
851
847
SIZE_AND_BYTES (AssociativityCache);
852
848
SIZE_AND_BYTES (DelayedConformanceDiags);
853
849
SIZE_AND_BYTES (LazyContexts);
854
- SIZE_AND_BYTES (ExistentialSignatures);
855
850
SIZE_AND_BYTES (ElementSignatures);
856
851
SIZE_AND_BYTES (Overrides);
857
852
SIZE_AND_BYTES (DefaultWitnesses);
@@ -6136,34 +6131,6 @@ CanGenericSignature ASTContext::getSingleGenericParameterSignature() const {
6136
6131
return canonicalSig;
6137
6132
}
6138
6133
6139
- CanGenericSignature
6140
- ASTContext::getOpenedExistentialSignature (Type type, GenericSignature parentSig) {
6141
- assert (type->isExistentialType ());
6142
-
6143
- if (auto existential = type->getAs <ExistentialType>())
6144
- type = existential->getConstraintType ();
6145
-
6146
- const CanType constraint = type->getCanonicalType ();
6147
-
6148
- auto canParentSig = parentSig.getCanonicalSignature ();
6149
- auto key = std::make_pair (constraint, canParentSig.getPointer ());
6150
- auto found = getImpl ().ExistentialSignatures .find (key);
6151
- if (found != getImpl ().ExistentialSignatures .end ())
6152
- return found->second ;
6153
-
6154
- LocalArchetypeRequirementCollector collector (*this , canParentSig);
6155
- collector.addOpenedExistential (type);
6156
- auto genericSig = buildGenericSignature (
6157
- *this , collector.OuterSig , collector.Params , collector.Requirements ,
6158
- /* allowInverses=*/ true ).getCanonicalSignature ();
6159
-
6160
- auto result = getImpl ().ExistentialSignatures .insert (
6161
- std::make_pair (key, genericSig));
6162
- ASSERT (result.second );
6163
-
6164
- return genericSig;
6165
- }
6166
-
6167
6134
OpenedExistentialSignature
6168
6135
ASTContext::getOpenedExistentialSignature (Type type) {
6169
6136
assert (type->isExistentialType ());
@@ -6193,8 +6160,13 @@ ASTContext::getOpenedExistentialSignature(Type type) {
6193
6160
// Open the generalization signature by adding a new generic parameter
6194
6161
// for `Self`.
6195
6162
auto parentSig = gen.Generalization .getGenericSignature ();
6196
- existentialSig.OpenedSig =
6197
- getOpenedExistentialSignature (gen.Shape , parentSig);
6163
+ auto canParentSig = parentSig.getCanonicalSignature ();
6164
+
6165
+ LocalArchetypeRequirementCollector collector (*this , canParentSig);
6166
+ collector.addOpenedExistential (gen.Shape );
6167
+ existentialSig.OpenedSig = buildGenericSignature (
6168
+ *this , collector.OuterSig , collector.Params , collector.Requirements ,
6169
+ /* allowInverses=*/ true ).getCanonicalSignature ();
6198
6170
6199
6171
// Stash the `Self` type.
6200
6172
existentialSig.SelfType =
0 commit comments