@@ -389,6 +389,7 @@ struct ASTContext::Implementation {
389
389
llvm::FoldingSet<TypeAliasType> TypeAliasTypes;
390
390
llvm::FoldingSet<TupleType> TupleTypes;
391
391
llvm::FoldingSet<PackType> PackTypes;
392
+ llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
392
393
llvm::DenseMap<llvm::PointerIntPair<TypeBase*, 3 , unsigned >,
393
394
MetatypeType*> MetatypeTypes;
394
395
llvm::DenseMap<llvm::PointerIntPair<TypeBase*, 3 , unsigned >,
@@ -471,7 +472,6 @@ struct ASTContext::Implementation {
471
472
llvm::FoldingSet<SILBoxType> SILBoxTypes;
472
473
llvm::DenseMap<BuiltinIntegerWidth, BuiltinIntegerType*> IntegerTypes;
473
474
llvm::FoldingSet<BuiltinVectorType> BuiltinVectorTypes;
474
- llvm::FoldingSet<PackExpansionType> PackExpansionTypes;
475
475
llvm::FoldingSet<DeclName::CompoundDeclName> CompoundNames;
476
476
llvm::DenseMap<UUID, OpenedArchetypeType *> OpenedExistentialArchetypes;
477
477
llvm::FoldingSet<IndexSubset> IndexSubsets;
@@ -2960,20 +2960,25 @@ Type TupleTypeElt::getType() const {
2960
2960
PackExpansionType *PackExpansionType::get (Type patternTy) {
2961
2961
assert (patternTy && " Missing pattern type in expansion" );
2962
2962
2963
+ auto properties = patternTy->getRecursiveProperties ();
2964
+ auto arena = getArena (properties);
2965
+
2963
2966
auto &context = patternTy->getASTContext ();
2964
2967
llvm::FoldingSetNodeID id;
2965
2968
PackExpansionType::Profile (id, patternTy);
2966
2969
2967
2970
void *insertPos;
2968
2971
if (PackExpansionType *expType =
2969
- context.getImpl ().PackExpansionTypes .FindNodeOrInsertPos (id,
2970
- insertPos))
2972
+ context.getImpl ()
2973
+ .getArena (arena)
2974
+ .PackExpansionTypes .FindNodeOrInsertPos (id, insertPos))
2971
2975
return expType;
2972
2976
2973
2977
const ASTContext *canCtx = patternTy->isCanonical () ? &context : nullptr ;
2974
2978
PackExpansionType *expansionTy = new (context, AllocationArena::Permanent)
2975
2979
PackExpansionType (patternTy, canCtx);
2976
- context.getImpl ().PackExpansionTypes .InsertNode (expansionTy, insertPos);
2980
+ context.getImpl ().getArena (arena).PackExpansionTypes .InsertNode (expansionTy,
2981
+ insertPos);
2977
2982
return expansionTy;
2978
2983
}
2979
2984
0 commit comments