Rangify two for loops in BitcodeReader.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239627 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Yaron Keren 2015-06-12 18:13:20 +00:00
parent 51be69023d
commit 923bd1da56

View 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.