[PATCH] [RuntimeDydlELF] Use range-based loop

Davide Italiano dccitaliano at gmail.com
Mon Jun 1 11:25:42 PDT 2015


Hi lhames,

Stumbled upon this while experimenting LLD section-based ELF backend.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10165

Files:
  lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp

Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
===================================================================
--- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
@@ -714,17 +714,15 @@
 
   // The TOC consists of sections .got, .toc, .tocbss, .plt in that
   // order. The TOC starts where the first of these sections starts.
-  for (section_iterator si = Obj.section_begin(), se = Obj.section_end();
-       si != se; ++si) {
-
+  for (auto &Section: Obj.sections()) {
     StringRef SectionName;
-    check(si->getName(SectionName));
+    check(Section.getName(SectionName));
 
     if (SectionName == ".got"
         || SectionName == ".toc"
         || SectionName == ".tocbss"
         || SectionName == ".plt") {
-      Rel.SectionID = findOrEmitSection(Obj, *si, false, LocalSections);
+      Rel.SectionID = findOrEmitSection(Obj, Section, false, LocalSections);
       break;
     }
   }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10165.26915.patch
Type: text/x-patch
Size: 970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150601/44ea290e/attachment.bin>


More information about the llvm-commits mailing list