[ValueMapper] Range-loopify to improve readability. NFC.
authorDavide Italiano <davide@freebsd.org>
Thu, 14 Apr 2016 18:07:32 +0000 (18:07 +0000)
committerDavide Italiano <davide@freebsd.org>
Thu, 14 Apr 2016 18:07:32 +0000 (18:07 +0000)
llvm-svn: 266350

llvm/lib/Transforms/Utils/ValueMapper.cpp

index 772800c..44efa5d 100644 (file)
@@ -747,11 +747,11 @@ void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VM,
 
 void Mapper::remapInstruction(Instruction *I) {
   // Remap operands.
-  for (User::op_iterator op = I->op_begin(), E = I->op_end(); op != E; ++op) {
-    Value *V = mapValue(*op);
+  for (Use &Op : I->operands()) {
+    Value *V = mapValue(Op);
     // If we aren't ignoring missing entries, assert that something happened.
     if (V)
-      *op = V;
+      Op = V;
     else
       assert((Flags & RF_IgnoreMissingLocals) &&
              "Referenced value not in value map!");