Reduce the amount of stack space we use in SmallVectors during
template instantiation. This helps reduce our stack footprint when
performing deep template instantiations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72582 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp
index ef351f0..6d7dc2e 100644
--- a/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -214,7 +214,7 @@
   Owner->addDecl(SemaRef.Context, Enum);
   Enum->startDefinition();
 
-  llvm::SmallVector<Sema::DeclPtrTy, 16> Enumerators;
+  llvm::SmallVector<Sema::DeclPtrTy, 4> Enumerators;
 
   EnumConstantDecl *LastEnumConst = 0;
   for (EnumDecl::enumerator_iterator EC = D->enumerator_begin(SemaRef.Context),
@@ -288,7 +288,7 @@
 
   Sema::LocalInstantiationScope Scope(SemaRef);
 
-  llvm::SmallVector<ParmVarDecl *, 16> Params;
+  llvm::SmallVector<ParmVarDecl *, 4> Params;
   QualType T = InstantiateFunctionType(D, Params);
   if (T.isNull())
     return 0;
@@ -331,7 +331,7 @@
 Decl *TemplateDeclInstantiator::VisitCXXConstructorDecl(CXXConstructorDecl *D) {
   Sema::LocalInstantiationScope Scope(SemaRef);
 
-  llvm::SmallVector<ParmVarDecl *, 16> Params;
+  llvm::SmallVector<ParmVarDecl *, 4> Params;
   QualType T = InstantiateFunctionType(D, Params);
   if (T.isNull())
     return 0;
@@ -378,7 +378,7 @@
 Decl *TemplateDeclInstantiator::VisitCXXDestructorDecl(CXXDestructorDecl *D) {
   Sema::LocalInstantiationScope Scope(SemaRef);
 
-  llvm::SmallVector<ParmVarDecl *, 16> Params;
+  llvm::SmallVector<ParmVarDecl *, 4> Params;
   QualType T = InstantiateFunctionType(D, Params);
   if (T.isNull())
     return 0;
@@ -409,7 +409,7 @@
 Decl *TemplateDeclInstantiator::VisitCXXConversionDecl(CXXConversionDecl *D) {
   Sema::LocalInstantiationScope Scope(SemaRef);
 
-  llvm::SmallVector<ParmVarDecl *, 16> Params;
+  llvm::SmallVector<ParmVarDecl *, 4> Params;
   QualType T = InstantiateFunctionType(D, Params);
   if (T.isNull())
     return 0;
@@ -505,7 +505,7 @@
 
   // Instantiate the function parameters
   TemplateDeclInstantiator ParamInstantiator(SemaRef, 0, TemplateArgs);
-  llvm::SmallVector<QualType, 16> ParamTys;
+  llvm::SmallVector<QualType, 4> ParamTys;
   for (FunctionDecl::param_iterator P = D->param_begin(), 
                                  PEnd = D->param_end();
        P != PEnd; ++P) {