From 923bd1da56c13d46f3ccc298f56b01ffa3a64c92 Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Fri, 12 Jun 2015 18:13:20 +0000 Subject: [PATCH] Rangify two for loops in BitcodeReader.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239627 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Reader/BitcodeReader.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 056d87beef1..23e9e379b03 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -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. -- 2.34.1