[C++11] Add range based accessors for the Use-Def chain of a Value.
[oota-llvm.git] / lib / Transforms / Utils / SimplifyInstructions.cpp
index 54d4e64531453f331340f3aad03b89d19b8c974c..bbd65f17528baaeec3ec2497995f47a72ad9333c 100644 (file)
@@ -68,9 +68,8 @@ namespace {
             if (!I->use_empty())
               if (Value *V = SimplifyInstruction(I, DL, TLI, DT)) {
                 // Mark all uses for resimplification next time round the loop.
-                for (Value::use_iterator UI = I->use_begin(), UE = I->use_end();
-                     UI != UE; ++UI)
-                  Next->insert(cast<Instruction>(*UI));
+                for (User *U : I->users())
+                  Next->insert(cast<Instruction>(U));
                 I->replaceAllUsesWith(V);
                 ++NumSimplified;
                 Changed = true;