/// getBundleStart - Returns the first instruction in the bundle containing MI.
///
inline MachineInstr *getBundleStart(MachineInstr *MI) {
- MachineBasicBlock::instr_iterator I = MI;
+ MachineBasicBlock::instr_iterator I(MI);
while (I->isBundledWithPred())
--I;
- return I;
+ return &*I;
}
inline const MachineInstr *getBundleStart(const MachineInstr *MI) {
- MachineBasicBlock::const_instr_iterator I = MI;
+ MachineBasicBlock::const_instr_iterator I(MI);
while (I->isBundledWithPred())
--I;
- return I;
+ return &*I;
}
/// Return an iterator pointing beyond the bundle containing MI.
inline MachineBasicBlock::instr_iterator
getBundleEnd(MachineInstr *MI) {
- MachineBasicBlock::instr_iterator I = MI;
+ MachineBasicBlock::instr_iterator I(MI);
while (I->isBundledWithSucc())
++I;
return ++I;
/// Return an iterator pointing beyond the bundle containing MI.
inline MachineBasicBlock::const_instr_iterator
getBundleEnd(const MachineInstr *MI) {
- MachineBasicBlock::const_instr_iterator I = MI;
+ MachineBasicBlock::const_instr_iterator I(MI);
while (I->isBundledWithSucc())
++I;
return ++I;
///
explicit MachineOperandIteratorBase(MachineInstr *MI, bool WholeBundle) {
if (WholeBundle) {
- InstrI = getBundleStart(MI);
+ InstrI = getBundleStart(MI)->getIterator();
InstrE = MI->getParent()->instr_end();
} else {
- InstrI = InstrE = MI;
+ InstrI = InstrE = MI->getIterator();
++InstrE;
}
OpI = InstrI->operands_begin();