[llvm-dev] arg_iterator missing inc/dec operators

Jonathan Roelofs via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 22 12:55:18 PDT 2017



On 3/22/17 12:58 PM, Dmitry Babokin via llvm-dev wrote:
> Reid,
>
> After your recent redefinition of arg_iterator, it's missing
> increment/decrement operators (which people typically expect to be
> defined for iterators). So some external code relying on this is broken.
> If it's not intentional, would be nice to have it fixed.
>
> Specific code that I is broken looks like this:
>
> llvm::Function f;
> foo(--f->arg_end()); // passing the last argument to the function.

The predecrement / decrement operators *do* exist on this iterator: 
https://github.com/llvm-mirror/llvm/blob/master/include/llvm/ADT/ilist_iterator.h#L153

Maybe you meant:

   llvm::Function *f;
   foo(&*--f->arg_end());

?

>
> Dmitry.
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded


More information about the llvm-dev mailing list