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:
parent
a6a7edd0c0
commit
eb5d1d285a
@ -75,12 +75,12 @@ inline MachineBasicBlock::const_instr_iterator getBundleEnd(
|
|||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// MachineOperand iterator
|
// MachineBundleOperand iterator
|
||||||
//
|
//
|
||||||
|
|
||||||
/// MachineOperandIteratorBase - Iterator that can visit all operands on a
|
/// MIBundleOperandIteratorBase - Iterator that visits all operands in a bundle
|
||||||
/// MachineInstr, or all operands on a bundle of MachineInstrs. This class is
|
/// of MachineInstrs. This class is not intended to be used directly, use one
|
||||||
/// not intended to be used directly, use one of the sub-classes instead.
|
/// of the sub-classes instead.
|
||||||
///
|
///
|
||||||
/// Intended use:
|
/// Intended use:
|
||||||
///
|
///
|
||||||
@ -90,7 +90,7 @@ inline MachineBasicBlock::const_instr_iterator getBundleEnd(
|
|||||||
/// ...
|
/// ...
|
||||||
/// }
|
/// }
|
||||||
///
|
///
|
||||||
class MachineOperandIteratorBase {
|
class MIBundleOperandIteratorBase {
|
||||||
MachineBasicBlock::instr_iterator InstrI, InstrE;
|
MachineBasicBlock::instr_iterator InstrI, InstrE;
|
||||||
MachineInstr::mop_iterator OpI, OpE;
|
MachineInstr::mop_iterator OpI, OpE;
|
||||||
|
|
||||||
@ -107,24 +107,17 @@ class MachineOperandIteratorBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
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.
|
/// on MI, or all operands on every instruction in the bundle containing MI.
|
||||||
///
|
///
|
||||||
/// @param MI The instruction to examine.
|
/// @param MI The instruction to examine.
|
||||||
/// @param WholeBundle When true, visit all operands on the entire bundle.
|
|
||||||
///
|
///
|
||||||
explicit MachineOperandIteratorBase(MachineInstr &MI, bool WholeBundle) {
|
explicit MIBundleOperandIteratorBase(MachineInstr &MI) {
|
||||||
if (WholeBundle) {
|
InstrI = getBundleStart(MI.getIterator());
|
||||||
InstrI = getBundleStart(MI.getIterator());
|
InstrE = MI.getParent()->instr_end();
|
||||||
InstrE = MI.getParent()->instr_end();
|
|
||||||
} else {
|
|
||||||
InstrI = InstrE = MI.getIterator();
|
|
||||||
++InstrE;
|
|
||||||
}
|
|
||||||
OpI = InstrI->operands_begin();
|
OpI = InstrI->operands_begin();
|
||||||
OpE = InstrI->operands_end();
|
OpE = InstrI->operands_end();
|
||||||
if (WholeBundle)
|
advance();
|
||||||
advance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MachineOperand &deref() const { return *OpI; }
|
MachineOperand &deref() const { return *OpI; }
|
||||||
@ -146,34 +139,14 @@ public:
|
|||||||
unsigned getOperandNo() const {
|
unsigned getOperandNo() const {
|
||||||
return OpI - InstrI->operands_begin();
|
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
|
/// MIBundleOperands - Iterate over all operands in a bundle of machine
|
||||||
/// instructions.
|
/// instructions.
|
||||||
///
|
///
|
||||||
class MIBundleOperands : public MachineOperandIteratorBase {
|
class MIBundleOperands : public MIBundleOperandIteratorBase {
|
||||||
public:
|
public:
|
||||||
MIBundleOperands(MachineInstr &MI) : MachineOperandIteratorBase(MI, true) {}
|
MIBundleOperands(MachineInstr &MI) : MIBundleOperandIteratorBase(MI) {}
|
||||||
MachineOperand &operator* () const { return deref(); }
|
MachineOperand &operator* () const { return deref(); }
|
||||||
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
|
/// ConstMIBundleOperands - Iterate over all operands in a const bundle of
|
||||||
/// machine instructions.
|
/// machine instructions.
|
||||||
///
|
///
|
||||||
class ConstMIBundleOperands : public MachineOperandIteratorBase {
|
class ConstMIBundleOperands : public MIBundleOperandIteratorBase {
|
||||||
public:
|
public:
|
||||||
ConstMIBundleOperands(const MachineInstr &MI)
|
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(); }
|
||||||
const MachineOperand *operator->() const { return &deref(); }
|
const MachineOperand *operator->() const { return &deref(); }
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user