[C++11] Add range based accessors for the Use-Def chain of a Value.
[oota-llvm.git] / lib / Target / NVPTX / NVPTXGenericToNVVM.cpp
index 860d93935742accbe79fc017f91c9bcd3633f2ac..45f0734c16c6fd378d33091d6e9891c8992d6bba 100644 (file)
@@ -146,10 +146,8 @@ bool GenericToNVVM::runOnModule(Module &M) {
     // variable initializers, as other uses have been already been removed
     // while walking through the instructions in function definitions.
     for (Value::use_iterator UI = GV->use_begin(), UE = GV->use_end();
-         UI != UE;) {
-      Use &U = (UI++).getUse();
-      U.set(BitCastNewGV);
-    }
+         UI != UE;)
+      (UI++)->set(BitCastNewGV);
     std::string Name = GV->getName();
     GV->removeDeadConstantUsers();
     GV->eraseFromParent();