[llvm-commits] [llvm] r52215 - /llvm/trunk/include/llvm/User.h
Gabor Greif
ggreif at gmail.com
Wed Jun 11 04:45:43 PDT 2008
Author: ggreif
Date: Wed Jun 11 06:45:26 2008
New Revision: 52215
URL: http://llvm.org/viewvc/llvm-project?rev=52215&view=rev
Log:
op_iterator-ify dropAllReferences
Modified:
llvm/trunk/include/llvm/User.h
Modified: llvm/trunk/include/llvm/User.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/User.h?rev=52215&r1=52214&r2=52215&view=diff
==============================================================================
--- llvm/trunk/include/llvm/User.h (original)
+++ llvm/trunk/include/llvm/User.h Wed Jun 11 06:45:26 2008
@@ -278,15 +278,14 @@
// 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
More information about the llvm-commits
mailing list