llvm.org GIT mirror llvm / 37e5484
op_iterator-ify dropAllReferences git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52215 91177308-0d34-0410-b5e6-96231b3b80d8 Gabor Greif 12 years ago
1 changed file(s) with 4 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
277277 // dropAllReferences() - This function is in charge of "letting go" of all
278278 // objects that this User refers to. This allows one to
279279 // 'delete' a whole class at a time, even though there may be circular
280 // references... first all references are dropped, and all use counts go to
281 // zero. Then everything is delete'd for real. Note that no operations are
280 // references... First all references are dropped, and all use counts go to
281 // zero. Then everything is deleted for real. Note that no operations are
282282 // valid on an object that has "dropped all references", except operator
283283 // delete.
284284 //
285285 void dropAllReferences() {
286 Use *OL = OperandList;
287 for (unsigned i = 0, e = NumOperands; i != e; ++i)
288 OL[i].set(0);
286 for (op_iterator i = op_begin(), e = op_end(); i != e; ++i)
287 i->set(0);
289288 }
290289
291290 /// replaceUsesOfWith - Replaces all references to the "From" definition with