<div dir="ltr"><div style>Agreed. We already have a generic range abstraction in lld (include/lld/Core/range.h) that I want to use for this, and I found that there was a discussion to move the file out of lld into llvm. Michael, what is the status of the plan?</div>

<div><br></div><a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130318/169097.html">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130318/169097.html</a><br></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Tue, May 28, 2013 at 11:02 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div><div class="h5"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 28, 2013 at 10:48 AM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>On Mon, May 27, 2013 at 7:35 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br>


</div></div><div class="gmail_extra"><div><div><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><p dir="ltr"><br>
On May 26, 2013 12:37 PM, "Rui Ueyama" <<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>> wrote:<br>
><br>
><br>
>> > +/// FilteredArgList - ArgList with filters. Useful to be used in<br>
>> > +/// range-based for loop to iterate over filtered arguments.<br>
>><br>
>> Could we just have/use a generic range abstraction (essentially a simple class template with two iterator members, one returned by begin, the other by end) rather than writing a custom type here?<br>
><br>
> What if begin is called twice? Is it okay to return the same object, not a new one?</p>
</div></div><p dir="ltr">If this is any kind of common iterator it must have the usual/obvious copy semantics (that's an iterator requirement) - essentially copying the result of begin should be as good as calling begin twice or there's something very strange/surprising going on (which isn't unheard of in llvm's iterators - so feel free to correct/tell me these are weird iterators that require a special case - I've not looked at them enough to know either way yet)</p>






</blockquote></div></div></div><div class="gmail_extra">No there's no such weird iterator in LLVM as far as I know. I just thought that we might want to avoid the overhead of copying the result of begin, which can be avoided by this patch. Or am I worry too much?</div>




</div></div>
</blockquote></div><br></div></div></div><div class="gmail_extra">Yeah, certainly worrying too much - iterators generally need to be cheap to copy & many algorithms will/should treat them as such. These ones certainly are, so far as I can tell - they're just SmallVector iterators, which are essentially just plain pointers (or the moral equivalent).</div>


</div>
</blockquote></div><br></div>