<div dir="rtl"><div dir="ltr">Thanks, fixed in r207831.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div dir="ltr">2014-05-02 3:46 GMT+03:00 Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span>:</div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
On 2014-May-01, at 5:33, Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>> wrote:<br>
<br>
> Author: yrnkrn<br>
> Date: Thu May  1 07:33:26 2014<br>
> New Revision: 207755<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=207755&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=207755&view=rev</a><br>
> Log:<br>
> Update post-r203364 <a href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140303/207915.html" target="_blank">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140303/207915.html</a><br>


> and ranged for loops.<br>
><br>
> <a href="http://reviews.llvm.org/D3582" target="_blank">http://reviews.llvm.org/D3582</a><br>
><br>
><br>
> Modified:<br>
>    llvm/trunk/docs/ProgrammersManual.rst<br>
><br>
> Modified: llvm/trunk/docs/ProgrammersManual.rst<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.rst?rev=207755&r1=207754&r2=207755&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/ProgrammersManual.rst?rev=207755&r1=207754&r2=207755&view=diff</a><br>


> ==============================================================================<br>
> --- llvm/trunk/docs/ProgrammersManual.rst (original)<br>
> +++ llvm/trunk/docs/ProgrammersManual.rst Thu May  1 07:33:26 2014<br>
> @@ -1738,16 +1738,12 @@ chain of ``F``:<br>
><br>
>   Function *F = ...;<br>
><br>
> -  for (Value::use_iterator i = F->use_begin(), e = F->use_end(); i != e; ++i)<br>
> -    if (Instruction *Inst = dyn_cast<Instruction>(*i)) {<br>
> +  for (User *U : GV->users()) {<br>
> +    if (Instruction *Inst = dyn_cast<Instruction>(U)) {<br>
>       errs() << "F is used in instruction:\n";<br>
>       errs() << *Inst << "\n";<br>
>     }<br>
><br>
> -Note that dereferencing a ``Value::use_iterator`` is not a very cheap operation.<br>
> -Instead of performing ``*i`` above several times, consider doing it only once in<br>
> -the loop body and reusing its result.<br>
> -<br>
> Alternatively, it's common to have an instance of the ``User`` Class (`doxygen<br>
> <<a href="http://llvm.org/doxygen/classllvm_1_1User.html" target="_blank">http://llvm.org/doxygen/classllvm_1_1User.html</a>>`__) and need to know what<br>
> ``Value``\ s are used by it.  The list of all ``Value``\ s used by a ``User`` is<br>
> @@ -1759,8 +1755,8 @@ instruction uses (that is, the operands<br>
><br>
>   Instruction *pi = ...;<br>
><br>
> -  for (User::op_iterator i = pi->op_begin(), e = pi->op_end(); i != e; ++i) {<br>
> -    Value *v = *i;<br>
> +  for (Use& U : pi->operands()) {<br>
<br>
</div></div>Style nit in the reference placement.  Should be:<br>
<div class="HOEnZb"><div class="h5"><br>
    for (Use &U : pi->operands()) {<br>
<br>
> +    Value *v = U.get();<br>
>     // ...<br>
>   }<br>
><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br>
</div></div></blockquote></div><br></div>