@@ -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);
@@ -6137,34 +6132,6 @@ CanGenericSignature ASTContext::getSingleGenericParameterSignature() const {
6137
6132
return canonicalSig;
6138
6133
}
6139
6134
6140
- CanGenericSignature
6141
- ASTContext::getOpenedExistentialSignature (Type type, GenericSignature parentSig) {
6142
- assert (type->isExistentialType ());
6143
-
6144
- if (auto existential = type->getAs <ExistentialType>())
6145
- type = existential->getConstraintType ();
6146
-
6147
- const CanType constraint = type->getCanonicalType ();
6148
-
6149
- auto canParentSig = parentSig.getCanonicalSignature ();
6150
- auto key = std::make_pair (constraint, canParentSig.getPointer ());
6151
- auto found = getImpl ().ExistentialSignatures .find (key);
6152
- if (found != getImpl ().ExistentialSignatures .end ())
6153
- return found->second ;
6154
-
6155
- LocalArchetypeRequirementCollector collector (*this , canParentSig);
6156
- collector.addOpenedExistential (type);
6157
- auto genericSig = buildGenericSignature (
6158
- *this , collector.OuterSig , collector.Params , collector.Requirements ,
6159
- /* allowInverses=*/ true ).getCanonicalSignature ();
6160
-
6161
- auto result = getImpl ().ExistentialSignatures .insert (
6162
- std::make_pair (key, genericSig));
6163
- ASSERT (result.second );
6164
-
6165
- return genericSig;
6166
- }
6167
-
6168
6135
OpenedExistentialSignature
6169
6136
ASTContext::getOpenedExistentialSignature (Type type) {
6170
6137
assert (type->isExistentialType ());
@@ -6194,8 +6161,13 @@ ASTContext::getOpenedExistentialSignature(Type type) {
6194
6161
// Open the generalization signature by adding a new generic parameter
6195
6162
// for `Self`.
6196
6163
auto parentSig = gen.Generalization .getGenericSignature ();
6197
- existentialSig.OpenedSig =
6198
- getOpenedExistentialSignature (gen.Shape , parentSig);
6164
+ auto canParentSig = parentSig.getCanonicalSignature ();
6165
+
6166
+ LocalArchetypeRequirementCollector collector (*this , canParentSig);
6167
+ collector.addOpenedExistential (gen.Shape );
6168
+ existentialSig.OpenedSig = buildGenericSignature (
6169
+ *this , collector.OuterSig , collector.Params , collector.Requirements ,
6170
+ /* allowInverses=*/ true ).getCanonicalSignature ();
6199
6171
6200
6172
// Stash the `Self` type.
6201
6173
existentialSig.SelfType =
0 commit comments