<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 6, 2015 at 3:37 PM, Duncan P. N. Exon Smith via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dexonsmith<br>
Date: Tue Oct 6 17:37:47 2015<br>
New Revision: 249480<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=249480&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=249480&view=rev</a><br>
Log:<br>
IR: Use auto for iterators, NFC<br>
<br>
Modified:<br>
llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h<br>
<br>
Modified: llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h?rev=249480&r1=249479&r2=249480&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h?rev=249480&r1=249479&r2=249480&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h (original)<br>
+++ llvm/trunk/lib/IR/SymbolTableListTraitsImpl.h Tue Oct 6 17:37:47 2015<br>
@@ -46,16 +46,14 @@ void SymbolTableListTraits<ValueSubClass<br>
<br>
if (OldST) {<br>
// Remove all entries from the previous symtab.<br>
- for (typename iplist<ValueSubClass>::iterator I = ItemList.begin();<br>
- I != ItemList.end(); ++I)<br>
+ for (auto I = ItemList.begin(); I != ItemList.end(); ++I)<br></blockquote><div><br></div><div>Is there a reason not to range-for these? (does 'end' need to be re-evaluated on every iteration (things being added/removed during the iteration?))</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
if (I->hasName())<br>
OldST->removeValueName(I->getValueName());<br>
}<br>
<br>
if (NewST) {<br>
// Add all of the items to the new symtab.<br>
- for (typename iplist<ValueSubClass>::iterator I = ItemList.begin();<br>
- I != ItemList.end(); ++I)<br>
+ for (auto I = ItemList.begin(); I != ItemList.end(); ++I)<br>
if (I->hasName())<br>
NewST->reinsertValue(I);<br>
}<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>