<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>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.<br><br><div>-Chris</div></div><div><br>On Mar 8, 2014, at 6:22 PM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>> wrote:<br><br></div><div><span></span></div><blockquote type="cite"><div><p dir="ltr"><br>
On Mar 8, 2014 7:58 PM, "Chris Lattner" <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:<br>
><br>
><br>
> On Mar 8, 2014, at 7:16 PM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>> wrote:<br>
><br>
> > Author: chandlerc<br>
> > Date: Sat Mar  8 21:16:01 2014<br>
> > New Revision: 203364<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=203364&view=rev">http://llvm.org/viewvc/llvm-project?rev=203364&view=rev</a><br>
> > Log:<br>
> > [C++11] Add range based accessors for the Use-Def chain of a Value.<br>
><br>
> Cool, thank you for working on this.<br>
><br>
> > Because #6 requires churning essentially everything that walked the<br>
> > Use-Def chains, I went ahead and added all of the range adaptors and<br>
> > switched them to range-based loops where appropriate. Also because the<br>
> > renaming requires at least churning every line of code, it didn't make<br>
> > any sense to split these up into multiple commits -- all of which would<br>
> > touch all of the same lies of code.<br>
><br>
> 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?</p>
<p dir="ltr">That plus ensuring the increment happened after the loop body.</p>
<p dir="ltr">I've left many as iterator loops. I'm looking at an adaptor that will greatly simplify most of the ones left.</p>
<p dir="ltr">><br>
> -Chris<br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</p>
</div></blockquote></body></html>