Iterator to enumerate machine operands

I want to enumerate all the operands of a machine instruction, but the
iterator seems to skip everything except virtual registers. Is this by
design?

MachineInstr.h

<code>
template<class MITy, class VTy>
  class ValOpIterator : public forward_iterator<VTy, ptrdiff_t> {
    void skipToNextVal() {
      while (i < MI->getNumOperands() &&
             !( (MI->getOperand(i).getType() ==
MachineOperand::MO_VirtualRegister ||
                 MI->getOperand(i).getType() == MachineOperand::MO_CCRegister)
                && MI->getOperand(i).getVRegValue() != 0))
        ++i;
    }
</code>

I want to enumerate all the operands of a machine instruction, but the
iterator seems to skip everything except virtual registers. Is this by
design?

Please don't use that, that is SparcV9 specific. Instead, do something like this:

   MachineInstr *MI = ...
   for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i)
     ... MI->getOperand(i) ...

-Chris

MachineInstr.h

<code>
template<class MITy, class VTy>
class ValOpIterator : public forward_iterator<VTy, ptrdiff_t> {
   void skipToNextVal() {
     while (i < MI->getNumOperands() &&
            !( (MI->getOperand(i).getType() ==
MachineOperand::MO_VirtualRegister ||
                MI->getOperand(i).getType() == MachineOperand::MO_CCRegister)
               && MI->getOperand(i).getVRegValue() != 0))
       ++i;
   }
</code>

-Chris