- inline Value *getOperand(unsigned i) {
- assert(i < Operands.size() && "getOperand() out of range!");
- return Operands[i];
+ /// NumOperands - The number of values used by this User.
+ ///
+ unsigned NumOperands;
+
+ void *operator new(size_t s, unsigned Us);
+ 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);
+ }
+public:
+ ~User() {
+ Use::zap(OperandList, OperandList + NumOperands);