@@ -821,7 +821,7 @@ Optional<unsigned> swift::_depthIndexToFlatIndex(
821821// / \returns true if the innermost descriptor is generic.
822822bool swift::_gatherGenericParameterCounts (
823823 const ContextDescriptor *descriptor,
824- std::vector <unsigned > &genericParamCounts,
824+ SmallVectorImpl <unsigned > &genericParamCounts,
825825 Demangler &BorrowFrom) {
826826 // If we have an extension descriptor, extract the extended type and use
827827 // that.
@@ -1027,7 +1027,7 @@ class DecodedMetadataBuilder {
10271027
10281028 // Figure out the various levels of generic parameters we have in
10291029 // this type.
1030- std::vector <unsigned > genericParamCounts;
1030+ SmallVector <unsigned , 8 > genericParamCounts;
10311031 (void )_gatherGenericParameterCounts (typeDecl, genericParamCounts, demangler);
10321032 unsigned numTotalGenericParams =
10331033 genericParamCounts.empty () ? 0 : genericParamCounts.back ();
@@ -1041,13 +1041,13 @@ class DecodedMetadataBuilder {
10411041 return BuiltType ();
10421042 }
10431043
1044- std::vector <const void *> allGenericArgsVec;
1044+ SmallVector <const void *, 8 > allGenericArgsVec;
10451045
10461046 // If there are generic parameters at any level, check the generic
10471047 // requirements and fill in the generic arguments vector.
10481048 if (!genericParamCounts.empty ()) {
10491049 // Compute the set of generic arguments "as written".
1050- std::vector <const Metadata *> allGenericArgs;
1050+ SmallVector <const Metadata *, 8 > allGenericArgs;
10511051
10521052 // If we have a parent, gather it's generic arguments "as written".
10531053 if (parent) {
@@ -1159,8 +1159,8 @@ class DecodedMetadataBuilder {
11591159 BuiltType createFunctionType (
11601160 ArrayRef<Demangle::FunctionParam<BuiltType>> params,
11611161 BuiltType result, FunctionTypeFlags flags) const {
1162- std::vector <BuiltType> paramTypes;
1163- std::vector <uint32_t > paramFlags;
1162+ SmallVector <BuiltType, 8 > paramTypes;
1163+ SmallVector <uint32_t , 8 > paramFlags;
11641164
11651165 // Fill in the parameters.
11661166 paramTypes.reserve (params.size ());
@@ -1625,7 +1625,7 @@ demangleToGenericParamRef(StringRef typeName) {
16251625void swift::gatherWrittenGenericArgs (
16261626 const Metadata *metadata,
16271627 const TypeContextDescriptor *description,
1628- std::vector <const Metadata *> &allGenericArgs,
1628+ SmallVectorImpl <const Metadata *> &allGenericArgs,
16291629 Demangler &BorrowFrom) {
16301630 auto generics = description->getGenericContext ();
16311631 if (!generics)
@@ -1679,7 +1679,7 @@ void swift::gatherWrittenGenericArgs(
16791679 // canonicalized away. Use same-type requirements to reconstitute them.
16801680
16811681 // Retrieve the mapping information needed for depth/index -> flat index.
1682- std::vector <unsigned > genericParamCounts;
1682+ SmallVector <unsigned , 8 > genericParamCounts;
16831683 (void )_gatherGenericParameterCounts (description, genericParamCounts,
16841684 BorrowFrom);
16851685
0 commit comments