[PATCH] Add FilteredArgList to represent filtered arglist

Rui Ueyama ruiu at google.com
Tue May 28 10:48:28 PDT 2013


On Mon, May 27, 2013 at 7:35 AM, David Blaikie <dblaikie at gmail.com> wrote:

>
> On May 26, 2013 12:37 PM, "Rui Ueyama" <ruiu at google.com> wrote:
> >
> >
> >> > +/// FilteredArgList - ArgList with filters. Useful to be used in
> >> > +/// range-based for loop to iterate over filtered arguments.
> >>
> >> 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?
> >
> > What if begin is called twice? Is it okay to return the same object, not
> a new one?
>
> 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)
>
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130528/91bc7de3/attachment.html>


More information about the llvm-commits mailing list