<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 13, 2015 at 11:11 AM, 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 13 13:11:02 2015<br>
New Revision: 250193<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=250193&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=250193&view=rev</a><br>
Log:<br>
ExecutionEngine: Remove implicit ilist iterator conversions, NFC<br></blockquote><div><br></div><div>BTW, I realize this is probably out of scope for your refactoring, but an alternative approach would be to make a lot of these functions take references instead of pointers so there's not adding lots of address-of operators all over the place. (I did this a lot with unique_ptr migrations - by making the underlying APIs take references intsead of pointers first, the actual unique_ptrification doesn't change the use at all (what was a pointer deref becomes a smart pointer deref - the same syntax) - not quite as clean in your case, there's still going to be a range-for-ification and/or a deref to be added, but otherwise might be nice)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Modified:<br>
    llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp<br>
<br>
Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=250193&r1=250192&r2=250193&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp?rev=250193&r1=250192&r2=250193&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp (original)<br>
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngine.cpp Tue Oct 13 13:11:02 2015<br>
@@ -237,11 +237,10 @@ void ExecutionEngine::clearAllGlobalMapp<br>
 void ExecutionEngine::clearGlobalMappingsFromModule(Module *M) {<br>
   MutexGuard locked(lock);<br>
<br>
-  for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)<br>
-    EEState.RemoveMapping(getMangledName(FI));<br>
-  for (Module::global_iterator GI = M->global_begin(), GE = M->global_end();<br>
-       GI != GE; ++GI)<br>
-    EEState.RemoveMapping(getMangledName(GI));<br>
+  for (Function &FI : *M)<br>
+    EEState.RemoveMapping(getMangledName(&FI));<br>
+  for (GlobalVariable &GI : M->globals())<br>
+    EEState.RemoveMapping(getMangledName(&GI));<br>
 }<br>
<br>
 uint64_t ExecutionEngine::updateGlobalMapping(const GlobalValue *GV,<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>