@@ -315,7 +315,7 @@ class TypeDecoder {
315315 if (Node->getNumChildren () < 2 )
316316 return BuiltType ();
317317
318- std::vector <BuiltType> args;
318+ SmallVector <BuiltType, 8 > args;
319319
320320 const auto &genericArgs = Node->getChild (1 );
321321 assert (genericArgs->getKind () == NodeKind::TypeList);
@@ -427,7 +427,7 @@ class TypeDecoder {
427427 return BuiltType ();
428428
429429 // Find the protocol list.
430- std::vector <BuiltProtocolDecl> Protocols;
430+ SmallVector <BuiltProtocolDecl, 8 > Protocols;
431431 auto TypeList = Node->getChild (0 );
432432 if (TypeList->getKind () == NodeKind::ProtocolList &&
433433 TypeList->getNumChildren () >= 1 ) {
@@ -514,7 +514,7 @@ class TypeDecoder {
514514 return BuiltType ();
515515
516516 bool hasParamFlags = false ;
517- std::vector <FunctionParam<BuiltType>> parameters;
517+ SmallVector <FunctionParam<BuiltType>, 8 > parameters;
518518 if (!decodeMangledFunctionInputType (Node->getChild (isThrow ? 1 : 0 ),
519519 parameters, hasParamFlags))
520520 return BuiltType ();
@@ -531,9 +531,9 @@ class TypeDecoder {
531531 }
532532 case NodeKind::ImplFunctionType: {
533533 auto calleeConvention = ImplParameterConvention::Direct_Unowned;
534- std::vector <ImplFunctionParam<BuiltType>> parameters;
535- std::vector <ImplFunctionResult<BuiltType>> results;
536- std::vector <ImplFunctionResult<BuiltType>> errorResults;
534+ SmallVector <ImplFunctionParam<BuiltType>, 8 > parameters;
535+ SmallVector <ImplFunctionResult<BuiltType>, 8 > results;
536+ SmallVector <ImplFunctionResult<BuiltType>, 8 > errorResults;
537537 ImplFunctionTypeFlags flags;
538538
539539 for (unsigned i = 0 ; i < Node->getNumChildren (); i++) {
@@ -611,7 +611,7 @@ class TypeDecoder {
611611 return decodeMangledType (Node->getChild (0 ));
612612
613613 case NodeKind::Tuple: {
614- std::vector <BuiltType> elements;
614+ SmallVector <BuiltType, 8 > elements;
615615 std::string labels;
616616 bool variadic = false ;
617617 for (auto &element : *Node) {
@@ -785,7 +785,7 @@ class TypeDecoder {
785785private:
786786 template <typename T>
787787 bool decodeImplFunctionPart (Demangle::NodePointer node,
788- std::vector <T> &results) {
788+ SmallVectorImpl <T> &results) {
789789 if (node->getNumChildren () != 2 )
790790 return true ;
791791
@@ -871,7 +871,7 @@ class TypeDecoder {
871871
872872 bool decodeMangledFunctionInputType (
873873 Demangle::NodePointer node,
874- std::vector <FunctionParam<BuiltType>> ¶ms,
874+ SmallVectorImpl <FunctionParam<BuiltType>> ¶ms,
875875 bool &hasParamFlags) {
876876 // Look through a couple of sugar nodes.
877877 if (node->getKind () == NodeKind::Type ||
0 commit comments