[C++11] Add range based accessors for the Use-Def chain of a Value.
[oota-llvm.git] / lib / Transforms / Scalar / ConstantProp.cpp
index 7625ad64b4adf8bcdca113ff36ea178db59e73e2..7045b365c21283517c606a7eb92fc13a0c4bb16e 100644 (file)
@@ -79,9 +79,8 @@ bool ConstantPropagation::runOnFunction(Function &F) {
       if (Constant *C = ConstantFoldInstruction(I, DL, TLI)) {
         // Add all of the users of this instruction to the worklist, they might
         // be constant propagatable now...
-        for (Value::use_iterator UI = I->use_begin(), UE = I->use_end();
-             UI != UE; ++UI)
-          WorkList.insert(cast<Instruction>(*UI));
+        for (User *U : I->users())
+          WorkList.insert(cast<Instruction>(U));
 
         // Replace all of the uses of a variable with uses of the constant.
         I->replaceAllUsesWith(C);