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> -- Tzu-Chien Chiu, 3D Graphics Hardware Architect <URL:http://www.csie.nctu.edu.tw/~jwchiu>
On Sat, 30 Jul 2005, Tzu-Chien Chiu wrote:> 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 -- http://nondot.org/sabre/ http://llvm.org/
Seemingly Similar Threads
- [LLVMdev] LiveIntervals, replace register with representative register?
- [LLVMdev] A patch for refine the cmake system and also configure
- [LLVMdev] HowToUseJIT.cpp - file: 'llvm/ADT/iterator': No suchfile or directory
- [LLVMdev] A patch for refine the cmake system and also configure
- [LLVMdev] A patch for refine the cmake system and also configure