Rangify two for loops in BitcodeReader.cpp.
authorYaron Keren <yaron.keren@gmail.com>
Fri, 12 Jun 2015 18:13:20 +0000 (18:13 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Fri, 12 Jun 2015 18:13:20 +0000 (18:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239627 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Reader/BitcodeReader.cpp

index 056d87beef151748eb22c051ba35221e56b9ae4f..23e9e379b035ed4fac3fff5411b3732b21dc6a89 100644 (file)
@@ -2690,20 +2690,15 @@ std::error_code BitcodeReader::GlobalCleanup() {
     return Error("Malformed global initializer set");
 
   // Look for intrinsic functions which need to be upgraded at some point
-  for (Module::iterator FI = TheModule->begin(), FE = TheModule->end();
-       FI != FE; ++FI) {
+  for (Function &F : *TheModule) {
     Function *NewFn;
-    if (UpgradeIntrinsicFunction(FI, NewFn))
-      UpgradedIntrinsics.push_back(std::make_pair(FI, NewFn));
+    if (UpgradeIntrinsicFunction(&F, NewFn))
+      UpgradedIntrinsics.push_back(std::make_pair(&F, NewFn));
   }
 
   // Look for global variables which need to be renamed.
-  for (Module::global_iterator
-         GI = TheModule->global_begin(), GE = TheModule->global_end();
-       GI != GE;) {
-    GlobalVariable *GV = GI++;
-    UpgradeGlobalVariable(GV);
-  }
+  for (GlobalVariable &GV : TheModule->globals())
+    UpgradeGlobalVariable(&GV);
 
   // Force deallocation of memory for these vectors to favor the client that
   // want lazy deserialization.