aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-06-11 11:45:26 +0000
committerGabor Greif <ggreif@gmail.com>2008-06-11 11:45:26 +0000
commit37e548400487d83cb9616dbeaebc7d838098cc49 (patch)
tree2c4dd14bf4b5f7672ce1568133179f197294a4a8
parentedfcf598faab9ce294712551ecf67093acd1c66e (diff)
op_iterator-ify dropAllReferences
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52215 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/User.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/include/llvm/User.h b/include/llvm/User.h
index 23967c7420..f1f41101cb 100644
--- a/include/llvm/User.h
+++ b/include/llvm/User.h
@@ -278,15 +278,14 @@ public:
// dropAllReferences() - This function is in charge of "letting go" of all
// objects that this User refers to. This allows one to
// 'delete' a whole class at a time, even though there may be circular
- // references... first all references are dropped, and all use counts go to
- // zero. Then everything is delete'd for real. Note that no operations are
+ // references... First all references are dropped, and all use counts go to
+ // zero. Then everything is deleted for real. Note that no operations are
// valid on an object that has "dropped all references", except operator
// delete.
//
void dropAllReferences() {
- Use *OL = OperandList;
- for (unsigned i = 0, e = NumOperands; i != e; ++i)
- OL[i].set(0);
+ for (op_iterator i = op_begin(), e = op_end(); i != e; ++i)
+ i->set(0);
}
/// replaceUsesOfWith - Replaces all references to the "From" definition with