[llvm] r264122 - [ModuleUtils] Use range-based loop. NFC.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 22 17:43:35 PDT 2016
Author: davide
Date: Tue Mar 22 19:43:35 2016
New Revision: 264122
URL: http://llvm.org/viewvc/llvm-project?rev=264122&view=rev
Log:
[ModuleUtils] Use range-based loop. NFC.
Modified:
llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp
Modified: llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp?rev=264122&r1=264121&r2=264122&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ModuleUtils.cpp Tue Mar 22 19:43:35 2016
@@ -99,8 +99,7 @@ llvm::collectUsedGlobalVariables(Module
return GV;
const ConstantArray *Init = cast<ConstantArray>(GV->getInitializer());
- for (unsigned I = 0, E = Init->getNumOperands(); I != E; ++I) {
- Value *Op = Init->getOperand(I);
+ for (Value *Op : Init->operands()) {
GlobalValue *G = cast<GlobalValue>(Op->stripPointerCastsNoFollowAliases());
Set.insert(G);
}
More information about the llvm-commits
mailing list