[llvm] r286146 - [lib/Object] Modernize. NFCI.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 13:01:42 PST 2016


Author: davide
Date: Mon Nov  7 15:01:42 2016
New Revision: 286146

URL: http://llvm.org/viewvc/llvm-project?rev=286146&view=rev
Log:
[lib/Object] Modernize. NFCI.

Modified:
    llvm/trunk/lib/Object/MachOUniversal.cpp

Modified: llvm/trunk/lib/Object/MachOUniversal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/MachOUniversal.cpp?rev=286146&r1=286145&r2=286146&view=diff
==============================================================================
--- llvm/trunk/lib/Object/MachOUniversal.cpp (original)
+++ llvm/trunk/lib/Object/MachOUniversal.cpp Mon Nov  7 15:01:42 2016
@@ -157,10 +157,9 @@ MachOUniversalBinary::getObjectForArch(S
                                               ArchName,
                                           object_error::arch_not_found);
 
-  for (object_iterator I = begin_objects(), E = end_objects(); I != E; ++I) {
-    if (I->getArchTypeName() == ArchName)
-      return I->getAsObjectFile();
-  }
+  for (auto &Obj : objects())
+    if (Obj.getArchTypeName() == ArchName)
+      return Obj.getAsObjectFile();
   return make_error<GenericBinaryError>("fat file does not "
                                         "contain " +
                                             ArchName,




More information about the llvm-commits mailing list