diff --git a/llvm/include/llvm/CodeGen/MachineInstrBundle.h b/llvm/include/llvm/CodeGen/MachineInstrBundle.h --- a/llvm/include/llvm/CodeGen/MachineInstrBundle.h +++ b/llvm/include/llvm/CodeGen/MachineInstrBundle.h @@ -111,20 +111,13 @@ /// on MI, or all operands on every instruction in the bundle containing MI. /// /// @param MI The instruction to examine. - /// @param WholeBundle When true, visit all operands on the entire bundle. /// - explicit MachineOperandIteratorBase(MachineInstr &MI, bool WholeBundle) { - if (WholeBundle) { - InstrI = getBundleStart(MI.getIterator()); - InstrE = MI.getParent()->instr_end(); - } else { - InstrI = InstrE = MI.getIterator(); - ++InstrE; - } + explicit MachineOperandIteratorBase(MachineInstr &MI) { + InstrI = getBundleStart(MI.getIterator()); + InstrE = MI.getParent()->instr_end(); OpI = InstrI->operands_begin(); OpE = InstrI->operands_end(); - if (WholeBundle) - advance(); + advance(); } MachineOperand &deref() const { return *OpI; } @@ -149,31 +142,12 @@ }; -/// MIOperands - Iterate over operands of a single instruction. -/// -class MIOperands : public MachineOperandIteratorBase { -public: - MIOperands(MachineInstr &MI) : MachineOperandIteratorBase(MI, false) {} - MachineOperand &operator* () const { return deref(); } - MachineOperand *operator->() const { return &deref(); } -}; - -/// ConstMIOperands - Iterate over operands of a single const instruction. -/// -class ConstMIOperands : public MachineOperandIteratorBase { -public: - ConstMIOperands(const MachineInstr &MI) - : MachineOperandIteratorBase(const_cast(MI), false) {} - const MachineOperand &operator* () const { return deref(); } - const MachineOperand *operator->() const { return &deref(); } -}; - /// MIBundleOperands - Iterate over all operands in a bundle of machine /// instructions. /// class MIBundleOperands : public MachineOperandIteratorBase { public: - MIBundleOperands(MachineInstr &MI) : MachineOperandIteratorBase(MI, true) {} + MIBundleOperands(MachineInstr &MI) : MachineOperandIteratorBase(MI) {} MachineOperand &operator* () const { return deref(); } MachineOperand *operator->() const { return &deref(); } }; @@ -184,7 +158,7 @@ class ConstMIBundleOperands : public MachineOperandIteratorBase { public: ConstMIBundleOperands(const MachineInstr &MI) - : MachineOperandIteratorBase(const_cast(MI), true) {} + : MachineOperandIteratorBase(const_cast(MI)) {} const MachineOperand &operator* () const { return deref(); } const MachineOperand *operator->() const { return &deref(); } };