[LLVMdev] Why "I = ++I" instead of "++I" in COFFDump.cpp ?

Reid Kleckner rnk at google.com
Fri Apr 4 10:44:49 PDT 2014


Looks like a bug.  This can probably be simplified with C++11.


On Fri, Apr 4, 2014 at 10:39 AM, Robison, Arch <arch.robison at intel.com>wrote:

> tools/llvm-objdump/COFFDump.cpp has two loops that advance the loop
> iterator using "I = ++I" instead of the usual "++I".  For example:
>
>   import_directory_iterator I = Obj->import_directory_begin();
>   import_directory_iterator E = Obj->import_directory_end();
>   if (I == E)
>     return;
>   outs() << "The Import Tables:\n";
>   for (; I != E; I = ++I) {
>       ...
>   }
>
> Is there a reason for writing "I = ++I" instead of "++I" ?
>
> - Arch D. Robison
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140404/9fec47a0/attachment.html>


More information about the llvm-dev mailing list