faisalv added inline comments.

================
Comment at: lib/Parse/ParseExprCXX.cpp:1116
+  if (HasExplicitTemplateParams) {
+    SmallVector<Decl*, 4> TemplateParams;
+    SourceLocation LAngleLoc, RAngleLoc;
----------------
hamzasood wrote:
> faisalv wrote:
> > hamzasood wrote:
> > > faisalv wrote:
> > > > Why not Just use/pass LSI->TemplateParams?
> > > I thought that Parser and Sema stay separate, and communicate through 
> > > various ActOn functions? Directly accessing LSI would violate that.
> > Aah yes - you're right.  Still it does seem a little wasteful to create two 
> > of those (and then append).  What are your thoughts about passing the 
> > argument by (moved from) value, and then swapping their guts within ActOn 
> > (i..e value-semantics) ?  (I suppose the only concern would be the small 
> > array case - but i think that would be quite easy for any optimizer to 
> > inline).   
> > 
> I don't think a SmallVectorImpl can be passed by value.
> 
> So to make that work, the function would either needed to be templated 
> (SmallVector<Decl*, I>) or only accept a SmallVector<Decl*, 4>. And I don't 
> think either of those options are worthwhile.
OK - add a FIXME that alerts folks that we currently make two copies of this 
and ideally we shouldn't need to.


https://reviews.llvm.org/D36527



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to