summaryrefslogtreecommitdiff
path: root/lib/Target/NVPTX/NVVMReflect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/NVPTX/NVVMReflect.cpp')
-rw-r--r--lib/Target/NVPTX/NVVMReflect.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Target/NVPTX/NVVMReflect.cpp b/lib/Target/NVPTX/NVVMReflect.cpp
index 5da8c2ed09..8b5444a66d 100644
--- a/lib/Target/NVPTX/NVVMReflect.cpp
+++ b/lib/Target/NVPTX/NVVMReflect.cpp
@@ -143,11 +143,9 @@ bool NVVMReflect::runOnModule(Module &M) {
// ConstantArray can be found successfully, see if it can be
// found in VarMap. If so, replace the uses of CallInst with the
// value found in VarMap. If not, replace the use with value 0.
- for (Value::use_iterator I = ReflectFunction->use_begin(),
- E = ReflectFunction->use_end();
- I != E; ++I) {
- assert(isa<CallInst>(*I) && "Only a call instruction can use _reflect");
- CallInst *Reflect = cast<CallInst>(*I);
+ for (User *U : ReflectFunction->users()) {
+ assert(isa<CallInst>(U) && "Only a call instruction can use _reflect");
+ CallInst *Reflect = cast<CallInst>(U);
assert((Reflect->getNumOperands() == 2) &&
"Only one operand expect for _reflect function");