Simplify the construction and destruction of Uses. Simplify
[oota-llvm.git] / include / llvm / User.h
index 74ebffa93cf84e3750e38ed07c466187780aefc5..2aca78c41a64c07423508888028486b2f95f0f5d 100644 (file)
@@ -50,12 +50,10 @@ protected:
   User(const Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
     : Value(ty, vty), OperandList(OpList), NumOperands(NumOps) {}
   Use *allocHungoffUses(unsigned) const;
-  void dropHungoffUses(Use *U) {
-    if (OperandList == U) {
-      OperandList = 0;
-      NumOperands = 0;
-    }
-    Use::zap(U, U->getImpliedUser(), true);
+  void dropHungoffUses() {
+    Use::zap(OperandList, OperandList + NumOperands, true);
+    OperandList = 0;
+    NumOperands = 0;
   }
 public:
   ~User() {