On Aug 4, 2015 8:12 AM, "Benjamin Kramer" <benny....@gmail.com> wrote:
>
>
> > On 04.08.2015, at 17:08, David Blaikie <dblai...@gmail.com> wrote:
> >
> >
> > On Aug 4, 2015 7:51 AM, "Benjamin Kramer" <benny....@googlemail.com>
wrote:
> > >
> > > Author: d0k
> > > Date: Tue Aug  4 09:46:06 2015
> > > New Revision: 243987
> > >
> > > URL: http://llvm.org/viewvc/llvm-project?rev=243987&view=rev
> > > Log:
> > > [Sema] Allocate SmallVector to the right size.
> > >
> > > SmallVector::set_size does not reallocate the vector. Sadly I have no
> > > idea how to test this. The vector never has more than one member in
all
> > > of the regression tests.
> >
> > Could try adding an assert and self hosting to find a non-singular
case? But yeah, I get that's probably not worth it.
>
> We may have crazy templated code in LLVM, but I'm 100% sure that we don't
have any friend functions with multiple template parameter lists ;)

Fair - I figured it might turn up in some stl implementation pieces etc.
But boost or the like is perhaps more likely.

> > Should we rename set_size something more intimidating/scary? That, or
I'd love to remove it...
>
> Naming suggestions welcome. Removing it is probably not feasible as
raw_svector_ostream relies on it.

Yeah... Not sure what the right answer there.

A while back I made a half hearted attempt to replace smallvector with
std::vector just to see how much perf the optimizations were getting us
(because there were some ops in smallvector and other containers that
werent so well defined (inserting subranges into the container the
subranges was in))

>
> - Ben
>
> > >
> > > Found by inspection.
> > >
> > > Modified:
> > >     cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
> > >
> > > Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
> > > URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=243987&r1=243986&r2=243987&view=diff
> > >
==============================================================================
> > > --- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
> > > +++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Tue Aug  4
09:46:06 2015
> > > @@ -1657,7 +1657,7 @@ TemplateDeclInstantiator::VisitCXXMethod
> > >    SmallVector<TemplateParameterList *, 4> TempParamLists;
> > >    unsigned NumTempParamLists = 0;
> > >    if (isFriend && (NumTempParamLists =
D->getNumTemplateParameterLists())) {
> > > -    TempParamLists.set_size(NumTempParamLists);
> > > +    TempParamLists.resize(NumTempParamLists);
> > >      for (unsigned I = 0; I != NumTempParamLists; ++I) {
> > >        TemplateParameterList *TempParams =
D->getTemplateParameterList(I);
> > >        TemplateParameterList *InstParams =
SubstTemplateParams(TempParams);
> > >
> > >
> > > _______________________________________________
> > > cfe-commits mailing list
> > > cfe-commits@cs.uiuc.edu
> > > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to