From ef5e7addb3df91285aa22d6165652e0f3bdabd5f Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Fri, 12 Jun 2015 18:13:20 +0000 Subject: Rangify two for loops in BitcodeReader.cpp. llvm-svn: 239627 --- llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp') diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 056d87b..23e9e37 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/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. -- cgit v1.1