[llvm] r203364 - [C++11] Add range based accessors for the Use-Def chain of a Value.

Chris Lattner clattner at apple.com
Sun Mar 9 15:18:38 PDT 2014


Sounds good.  Bulk conversion to foreach loops is the piece of c++11'ification that I'm most nervous of, because it has the risk of introducing subtle iterator invalidation bugs.

-Chris

> On Mar 8, 2014, at 6:22 PM, Chandler Carruth <chandlerc at gmail.com> wrote:
> 
> 
> On Mar 8, 2014 7:58 PM, "Chris Lattner" <clattner at apple.com> wrote:
> >
> >
> > On Mar 8, 2014, at 7:16 PM, Chandler Carruth <chandlerc at gmail.com> wrote:
> >
> > > Author: chandlerc
> > > Date: Sat Mar  8 21:16:01 2014
> > > New Revision: 203364
> > >
> > > URL: http://llvm.org/viewvc/llvm-project?rev=203364&view=rev
> > > Log:
> > > [C++11] Add range based accessors for the Use-Def chain of a Value.
> >
> > Cool, thank you for working on this.
> >
> > > Because #6 requires churning essentially everything that walked the
> > > Use-Def chains, I went ahead and added all of the range adaptors and
> > > switched them to range-based loops where appropriate. Also because the
> > > renaming requires at least churning every line of code, it didn't make
> > > any sense to split these up into multiple commits -- all of which would
> > > touch all of the same lies of code.
> >
> > How did you check that it was safe to convert these cases to foreach loops?  Did you only convert loops that explicitly precalculated the end() point?
> 
> That plus ensuring the increment happened after the loop body.
> 
> I've left many as iterator loops. I'm looking at an adaptor that will greatly simplify most of the ones left.
> 
> >
> > -Chris
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140309/0fcfa886/attachment.html>


More information about the llvm-commits mailing list