[PATCH][review request] Use ArrayRef in SemaInit.cpp. Try 3

David Blaikie dblaikie at gmail.com
Fri May 3 13:57:25 PDT 2013


(Also, as an aside: please avoid changing the subject line in your emails
(such as 'try 3" above) as it breaks threading in some email clients, like
gmail)
On May 3, 2013 7:09 AM, "Robert Wilhelm" <robert.wilhelm at gmx.net> wrote:

> Thanks for the review.
> Mutability is only needed in the ctor.
> I have attached new updated patch.
>
> Robert
>
> On Fri, 2013-05-03 at 16:08 +0300, Dmitri Gribenko wrote:
> > On Fri, May 3, 2013 at 3:59 PM, Robert Wilhelm <robert.wilhelm at gmx.net>
> wrote:
> > > Hello David,
> > >
> > >  This patch switches to ArrayRef in SemaInit.cpp.
> >
> > Are you sure that we want to use MultiExprArg?  It is a
> > MutableArrayRef instead of a plain ArrayRef:
> >
> > typedef llvm::MutableArrayRef<Expr*> MultiExprArg;
> >
> > Is mutability needed here?
> >
> > +  for (unsigned I = 0, J= Args.size(); I != J; ++I)
> >
> > 'J' is not a good name for element count.  Please rename J to E and
> > add a space before '='.
> >
> >        Expr *InitListAsExpr = InitList;
> > -      Expr **Args = InitList ? &InitListAsExpr : 0;
> > -      unsigned NumArgs = InitList ? 1 : 0;
> > +      MultiExprArg Args(&InitListAsExpr, InitList ? 1 : 0);
> >
> > No tabs, please.
> >
> > Dmitri
> >
> > --
> > main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> > (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130503/a7ff307a/attachment.html>


More information about the cfe-commits mailing list