@@ -262,10 +262,6 @@ struct ASTContext::Implementation {
262262 llvm::FoldingSet<ProtocolType> ProtocolTypes;
263263 llvm::FoldingSet<LayoutConstraintInfo> LayoutConstraints;
264264
265- llvm::DenseMap<std::pair<TypeBase *, DeclContext *>,
266- SubstitutionList>
267- BoundGenericSubstitutions;
268-
269265 // / The set of normal protocol conformances.
270266 llvm::FoldingSet<NormalProtocolConformance> NormalConformances;
271267
@@ -1101,52 +1097,6 @@ static AllocationArena getArena(RecursiveTypeProperties properties) {
11011097 : AllocationArena::Permanent;
11021098}
11031099
1104- Optional<SubstitutionList>
1105- ASTContext::createTrivialSubstitutions (BoundGenericType *BGT,
1106- DeclContext *gpContext) const {
1107- assert (gpContext && " No generic parameter context" );
1108- assert (gpContext->getGenericEnvironmentOfContext () != nullptr &&
1109- " Not type-checked yet" );
1110- assert (BGT->getGenericArgs ().size () == 1 );
1111- Substitution Subst (BGT->getGenericArgs ()[0 ], {});
1112- auto Substitutions = AllocateCopy (llvm::makeArrayRef (Subst));
1113- auto arena = getArena (BGT->getRecursiveProperties ());
1114- Impl.getArena (arena).BoundGenericSubstitutions
1115- .insert (std::make_pair (std::make_pair (BGT, gpContext), Substitutions));
1116- return Substitutions;
1117- }
1118-
1119- Optional<SubstitutionList>
1120- ASTContext::getSubstitutions (TypeBase *type,
1121- DeclContext *gpContext) const {
1122- assert (gpContext && " Missing generic parameter context" );
1123- auto arena = getArena (type->getRecursiveProperties ());
1124- auto &boundGenericSubstitutions
1125- = Impl.getArena (arena).BoundGenericSubstitutions ;
1126- auto known = boundGenericSubstitutions.find ({type, gpContext});
1127- if (known != boundGenericSubstitutions.end ())
1128- return known->second ;
1129-
1130- // We can trivially create substitutions for Array and Optional.
1131- if (auto bound = dyn_cast<BoundGenericType>(type))
1132- if (bound->getDecl () == getArrayDecl () ||
1133- bound->getDecl () == getOptionalDecl ())
1134- return createTrivialSubstitutions (bound, gpContext);
1135-
1136- return None;
1137- }
1138-
1139- void ASTContext::setSubstitutions (TypeBase* type,
1140- DeclContext *gpContext,
1141- SubstitutionList Subs) const {
1142- auto arena = getArena (type->getRecursiveProperties ());
1143- auto &boundGenericSubstitutions
1144- = Impl.getArena (arena).BoundGenericSubstitutions ;
1145- assert (boundGenericSubstitutions.count ({type, gpContext}) == 0 &&
1146- " Already have substitutions?" );
1147- boundGenericSubstitutions[{type, gpContext}] = Subs;
1148- }
1149-
11501100void ASTContext::addSearchPath (StringRef searchPath, bool isFramework,
11511101 bool isSystem) {
11521102 OptionSet<SearchPathKind> &loaded = Impl.SearchPathsSet [searchPath];
@@ -1609,13 +1559,12 @@ size_t ASTContext::Implementation::Arena::getTotalMemory() const {
16091559 llvm::capacity_in_bytes (LValueTypes) +
16101560 llvm::capacity_in_bytes (InOutTypes) +
16111561 llvm::capacity_in_bytes (DependentMemberTypes) +
1612- llvm::capacity_in_bytes (DynamicSelfTypes) +
1562+ llvm::capacity_in_bytes (DynamicSelfTypes);
16131563 // EnumTypes ?
16141564 // StructTypes ?
16151565 // ClassTypes ?
16161566 // UnboundGenericTypes ?
16171567 // BoundGenericTypes ?
1618- llvm::capacity_in_bytes (BoundGenericSubstitutions);
16191568 // NormalConformances ?
16201569 // SpecializedConformances ?
16211570 // InheritedConformances ?
0 commit comments