@@ -567,6 +567,7 @@ struct ASTContext::Implementation {
567
567
llvm::DenseMap<Type, ExistentialType *> ExistentialTypes;
568
568
llvm::FoldingSet<UnboundGenericType> UnboundGenericTypes;
569
569
llvm::FoldingSet<BoundGenericType> BoundGenericTypes;
570
+ llvm::FoldingSet<BuiltinFixedArrayType> BuiltinFixedArrayTypes;
570
571
llvm::FoldingSet<ProtocolCompositionType> ProtocolCompositionTypes;
571
572
llvm::FoldingSet<ParameterizedProtocolType> ParameterizedProtocolTypes;
572
573
llvm::FoldingSet<LayoutConstraintInfo> LayoutConstraints;
@@ -632,7 +633,6 @@ struct ASTContext::Implementation {
632
633
llvm::DenseMap<BuiltinIntegerWidth, BuiltinIntegerType*> BuiltinIntegerTypes;
633
634
llvm::DenseMap<unsigned , BuiltinUnboundGenericType*> BuiltinUnboundGenericTypes;
634
635
llvm::FoldingSet<BuiltinVectorType> BuiltinVectorTypes;
635
- llvm::FoldingSet<BuiltinFixedArrayType> BuiltinFixedArrayTypes;
636
636
llvm::FoldingSet<DeclName::CompoundDeclName> CompoundNames;
637
637
llvm::DenseMap<UUID, GenericEnvironment *> OpenedElementEnvironments;
638
638
llvm::FoldingSet<IndexSubset> IndexSubsets;
@@ -3737,20 +3737,26 @@ BuiltinUnboundGenericType::get(TypeKind genericTypeKind,
3737
3737
3738
3738
BuiltinFixedArrayType *BuiltinFixedArrayType::get (CanType Size,
3739
3739
CanType ElementType) {
3740
+ RecursiveTypeProperties properties;
3741
+ properties |= Size->getRecursiveProperties ();
3742
+ properties |= ElementType->getRecursiveProperties ();
3743
+
3744
+ AllocationArena arena = getArena (properties);
3745
+
3740
3746
llvm::FoldingSetNodeID id;
3741
3747
BuiltinFixedArrayType::Profile (id, Size, ElementType);
3742
- auto &context = Size->getASTContext ();
3748
+ auto &ctx = Size->getASTContext ();
3743
3749
3744
3750
void *insertPos;
3745
- if (BuiltinFixedArrayType *vecType
3746
- = context .getImpl ().BuiltinFixedArrayTypes
3751
+ if (BuiltinFixedArrayType *faTy
3752
+ = ctx .getImpl (). getArena (arena ).BuiltinFixedArrayTypes
3747
3753
.FindNodeOrInsertPos (id, insertPos))
3748
- return vecType ;
3754
+ return faTy ;
3749
3755
3750
3756
BuiltinFixedArrayType *faTy
3751
- = new (context, AllocationArena::Permanent)
3752
- BuiltinFixedArrayType (Size, ElementType);
3753
- context. getImpl (). BuiltinFixedArrayTypes .InsertNode (faTy, insertPos);
3757
+ = new (ctx, arena) BuiltinFixedArrayType (Size, ElementType, properties);
3758
+ ctx. getImpl (). getArena (arena). BuiltinFixedArrayTypes
3759
+ .InsertNode (faTy, insertPos);
3754
3760
return faTy;
3755
3761
}
3756
3762
0 commit comments