[PATCH] D70560: [MIBundle] Remove unused/obsolete MIOperands/ConstMIOperands (NFC).
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 21 12:49:19 PST 2019
fhahn created this revision.
fhahn added reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm.
Herald added a subscriber: wdng.
Herald added a project: LLVM.
Those iterators are unused and the respective iterators from
MachineBasicBlock should be used.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D70560
Files:
llvm/include/llvm/CodeGen/MachineInstrBundle.h
Index: llvm/include/llvm/CodeGen/MachineInstrBundle.h
===================================================================
--- llvm/include/llvm/CodeGen/MachineInstrBundle.h
+++ 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<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 {
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<MachineInstr &>(MI), true) {}
+ : MachineOperandIteratorBase(const_cast<MachineInstr &>(MI)) {}
const MachineOperand &operator* () const { return deref(); }
const MachineOperand *operator->() const { return &deref(); }
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70560.230512.patch
Type: text/x-patch
Size: 2714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191121/0b8929c9/attachment.bin>
More information about the llvm-commits
mailing list