for (const_instr_iterator I = instr_begin(); I != instr_end(); ++I) {
if (Indexes) {
- if (Indexes->hasIndex(I))
- OS << Indexes->getInstructionIndex(I);
+ if (Indexes->hasIndex(&*I))
+ OS << Indexes->getInstructionIndex(&*I);
OS << '\t';
}
OS << '\t';
}
void MachineBasicBlock::moveBefore(MachineBasicBlock *NewAfter) {
- getParent()->splice(NewAfter, this);
+ getParent()->splice(NewAfter->getIterator(), getIterator());
}
void MachineBasicBlock::moveAfter(MachineBasicBlock *NewBefore) {
- MachineFunction::iterator BBI = NewBefore;
- getParent()->splice(++BBI, this);
+ getParent()->splice(++NewBefore->getIterator(), getIterator());
}
void MachineBasicBlock::updateTerminator() {
}
bool MachineBasicBlock::canFallThrough() {
- MachineFunction::iterator Fallthrough = this;
+ MachineFunction::iterator Fallthrough = getIterator();
++Fallthrough;
// If FallthroughBlock is off the end of the function, it can't fall through.
if (Fallthrough == getParent()->end())
return false;
// If FallthroughBlock isn't a successor, no fallthrough is possible.
- if (!isSuccessor(Fallthrough))
+ if (!isSuccessor(&*Fallthrough))
return false;
// Analyze the branches, if any, at the end of the block.
if (LV)
for (instr_iterator I = getFirstInstrTerminator(), E = instr_end();
I != E; ++I) {
- MachineInstr *MI = I;
+ MachineInstr *MI = &*I;
for (MachineInstr::mop_iterator OI = MI->operands_begin(),
OE = MI->operands_end(); OI != OE; ++OI) {
if (!OI->isReg() || OI->getReg() == 0 ||
if (LIS) {
for (instr_iterator I = getFirstInstrTerminator(), E = instr_end();
I != E; ++I) {
- MachineInstr *MI = I;
+ MachineInstr *MI = &*I;
for (MachineInstr::mop_iterator OI = MI->operands_begin(),
OE = MI->operands_end(); OI != OE; ++OI) {
if (Indexes) {
for (instr_iterator I = getFirstInstrTerminator(), E = instr_end();
I != E; ++I)
- Terminators.push_back(I);
+ Terminators.push_back(&*I);
}
updateTerminator();
SmallVector<MachineInstr*, 4> NewTerminators;
for (instr_iterator I = getFirstInstrTerminator(), E = instr_end();
I != E; ++I)
- NewTerminators.push_back(I);
+ NewTerminators.push_back(&*I);
for (SmallVectorImpl<MachineInstr*>::iterator I = Terminators.begin(),
E = Terminators.end(); I != E; ++I) {
I != E; ++I) {
// Some instructions may have been moved to NMBB by updateTerminator(),
// so we first remove any instruction that already has an index.
- if (Indexes->hasIndex(I))
- Indexes->removeMachineInstrFromMaps(I);
- Indexes->insertMachineInstrInMaps(I);
+ if (Indexes->hasIndex(&*I))
+ Indexes->removeMachineInstrFromMaps(&*I);
+ Indexes->insertMachineInstrInMaps(&*I);
}
}
}
if (!(--I)->addRegisterKilled(Reg, TRI, /* addIfNotFound= */ false))
continue;
if (TargetRegisterInfo::isVirtualRegister(Reg))
- LV->getVarInfo(Reg).Kills.push_back(I);
+ LV->getVarInfo(Reg).Kills.push_back(&*I);
DEBUG(dbgs() << "Restored terminator kill: " << *I);
break;
}
MachineBasicBlock::instr_iterator
MachineBasicBlock::erase(MachineBasicBlock::instr_iterator I) {
- unbundleSingleMI(I);
+ unbundleSingleMI(&*I);
return Insts.erase(I);
}
bool Changed = false;
- MachineFunction::iterator FallThru =
- std::next(MachineFunction::iterator(this));
+ MachineFunction::iterator FallThru = std::next(getIterator());
if (!DestA && !DestB) {
// Block falls through to successor.
- DestA = FallThru;
- DestB = FallThru;
+ DestA = &*FallThru;
+ DestB = &*FallThru;
} else if (DestA && !DestB) {
if (IsCond)
// Block ends in conditional jump that falls through to successor.
- DestB = FallThru;
+ DestB = &*FallThru;
} else {
assert(DestA && DestB && IsCond &&
"CFG in a bad state. Cannot correct CFG edges");