1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

[MIBundle] Remove unused/obsolete MIOperands/ConstMIOperands (NFC).

Those iterators are unused and the respective iterators from
MachineInstr should be used (e.g. MachineInstr::operands(),
https://llvm.org/doxygen/classllvm_1_1MachineInstr.html#aef0e7e42e45e15f86b2a122b56ab829c)

Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm, ab

Reviewed By: ab

Differential Revision: https://reviews.llvm.org/D70560
This commit is contained in:
Florian Hahn 2019-12-04 20:46:08 +00:00
parent a6a7edd0c0
commit eb5d1d285a

View File

@ -75,12 +75,12 @@ inline MachineBasicBlock::const_instr_iterator getBundleEnd(
}
//===----------------------------------------------------------------------===//
// MachineOperand iterator
// MachineBundleOperand iterator
//
/// MachineOperandIteratorBase - Iterator that can visit all operands on a
/// MachineInstr, or all operands on a bundle of MachineInstrs. This class is
/// not intended to be used directly, use one of the sub-classes instead.
/// MIBundleOperandIteratorBase - Iterator that visits all operands in a bundle
/// of MachineInstrs. This class is not intended to be used directly, use one
/// of the sub-classes instead.
///
/// Intended use:
///
@ -90,7 +90,7 @@ inline MachineBasicBlock::const_instr_iterator getBundleEnd(
/// ...
/// }
///
class MachineOperandIteratorBase {
class MIBundleOperandIteratorBase {
MachineBasicBlock::instr_iterator InstrI, InstrE;
MachineInstr::mop_iterator OpI, OpE;
@ -107,24 +107,17 @@ class MachineOperandIteratorBase {
}
protected:
/// MachineOperandIteratorBase - Create an iterator that visits all operands
/// MIBundleOperandIteratorBase - Create an iterator that visits all operands
/// 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 MIBundleOperandIteratorBase(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; }
@ -146,34 +139,14 @@ public:
unsigned getOperandNo() const {
return OpI - InstrI->operands_begin();
}
};
/// 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<MachineInstr &>(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 {
class MIBundleOperands : public MIBundleOperandIteratorBase {
public:
MIBundleOperands(MachineInstr &MI) : MachineOperandIteratorBase(MI, true) {}
MIBundleOperands(MachineInstr &MI) : MIBundleOperandIteratorBase(MI) {}
MachineOperand &operator* () const { return deref(); }
MachineOperand *operator->() const { return &deref(); }
};
@ -181,10 +154,10 @@ public:
/// ConstMIBundleOperands - Iterate over all operands in a const bundle of
/// machine instructions.
///
class ConstMIBundleOperands : public MachineOperandIteratorBase {
class ConstMIBundleOperands : public MIBundleOperandIteratorBase {
public:
ConstMIBundleOperands(const MachineInstr &MI)
: MachineOperandIteratorBase(const_cast<MachineInstr &>(MI), true) {}
: MIBundleOperandIteratorBase(const_cast<MachineInstr &>(MI)) {}
const MachineOperand &operator* () const { return deref(); }
const MachineOperand *operator->() const { return &deref(); }
};