[llvm-dev] arg_iterator missing inc/dec operators

Dmitry Babokin via llvm-dev llvm-dev at lists.llvm.org
Wed Mar 22 13:12:50 PDT 2017


> 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());
>
> ?
>

Correct, I mean exactly this. Though &* is not important in this case.

This code doesn't work anymore, as arg_iterator is defined differently now:
https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/Function.h#L57

I get an error when I'm using pre-decrement operator:
error: expression is not assignable
      --f->arg_end();

Dmitry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170322/3ffca78c/attachment.html>


More information about the llvm-dev mailing list