1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

CodeGen: Start removing implicit conversions to/from list iterators, NFC

Start removing implicit conversions to/from list iterators in CodeGen,
ala r249782 for IR.  A lot more to go after this.

llvm-svn: 249851
This commit is contained in:
Duncan P. N. Exon Smith 2015-10-09 16:54:49 +00:00
parent 19c33acd34
commit a926547925
6 changed files with 18 additions and 18 deletions

View File

@ -260,7 +260,7 @@ public:
for (BasicBlock::iterator J = BB->begin(), JE = BB->end(); J != JE; ++J)
if (isa<CallInst>(J) || isa<InvokeInst>(J)) {
ImmutableCallSite CS(J);
ImmutableCallSite CS(&*J);
if (const Function *F = CS.getCalledFunction()) {
if (!static_cast<T *>(this)->isLoweredToCall(F))
continue;

View File

@ -181,7 +181,7 @@ public:
Ty &operator*() const { return *MII; }
Ty *operator->() const { return &operator*(); }
operator Ty*() const { return MII; }
operator Ty *() const { return MII.getNodePtrUnchecked(); }
bool operator==(const bundle_iterator &X) const {
return MII == X.MII;
@ -600,7 +600,7 @@ public:
/// remove_instr to remove individual instructions from a bundle.
MachineInstr *remove(MachineInstr *I) {
assert(!I->isBundled() && "Cannot remove bundled instructions");
return Insts.remove(I);
return Insts.remove(instr_iterator(I));
}
/// Remove the possibly bundled instruction from the instruction list

View File

@ -274,7 +274,7 @@ inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
const MCInstrDesc &MCID,
unsigned DestReg) {
if (I->isInsideBundle()) {
MachineBasicBlock::instr_iterator MII = I;
MachineBasicBlock::instr_iterator MII(I);
return BuildMI(BB, MII, DL, MCID, DestReg);
}
@ -310,7 +310,7 @@ inline MachineInstrBuilder BuildMI(MachineBasicBlock &BB,
DebugLoc DL,
const MCInstrDesc &MCID) {
if (I->isInsideBundle()) {
MachineBasicBlock::instr_iterator MII = I;
MachineBasicBlock::instr_iterator MII(I);
return BuildMI(BB, MII, DL, MCID);
}
@ -462,7 +462,7 @@ public:
if (I == Begin) {
if (!empty())
MI->bundleWithSucc();
Begin = MI;
Begin = MI->getIterator();
return *this;
}
if (I == End) {

View File

@ -44,23 +44,23 @@ bool finalizeBundles(MachineFunction &MF);
/// 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;
@ -69,7 +69,7 @@ getBundleEnd(MachineInstr *MI) {
/// 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;
@ -116,10 +116,10 @@ protected:
///
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();

View File

@ -317,7 +317,7 @@ bool AtomicExpand::expandAtomicRMWToLLSC(AtomicRMWInst *AI) {
// atomicrmw.end:
// fence?
// [...]
BasicBlock *ExitBB = BB->splitBasicBlock(AI, "atomicrmw.end");
BasicBlock *ExitBB = BB->splitBasicBlock(AI->getIterator(), "atomicrmw.end");
BasicBlock *LoopBB = BasicBlock::Create(Ctx, "atomicrmw.start", F, ExitBB);
// This grabs the DebugLoc from AI.
@ -393,7 +393,7 @@ bool AtomicExpand::expandAtomicCmpXchg(AtomicCmpXchgInst *CI) {
// %restmp = insertvalue { iN, i1 } undef, iN %loaded, 0
// %res = insertvalue { iN, i1 } %restmp, i1 %success, 1
// [...]
BasicBlock *ExitBB = BB->splitBasicBlock(CI, "cmpxchg.end");
BasicBlock *ExitBB = BB->splitBasicBlock(CI->getIterator(), "cmpxchg.end");
auto FailureBB = BasicBlock::Create(Ctx, "cmpxchg.failure", F, ExitBB);
auto NoStoreBB = BasicBlock::Create(Ctx, "cmpxchg.nostore", F, FailureBB);
auto SuccessBB = BasicBlock::Create(Ctx, "cmpxchg.success", F, NoStoreBB);
@ -549,7 +549,7 @@ bool llvm::expandAtomicRMWToCmpXchg(AtomicRMWInst *AI,
// br i1 %success, label %atomicrmw.end, label %loop
// atomicrmw.end:
// [...]
BasicBlock *ExitBB = BB->splitBasicBlock(AI, "atomicrmw.end");
BasicBlock *ExitBB = BB->splitBasicBlock(AI->getIterator(), "atomicrmw.end");
BasicBlock *LoopBB = BasicBlock::Create(Ctx, "atomicrmw.start", F, ExitBB);
// This grabs the DebugLoc from AI.

View File

@ -751,7 +751,7 @@ bool ExeDepsFix::runOnMachineFunction(MachineFunction &mf) {
AliasMap[*AI].push_back(i);
}
MachineBasicBlock *Entry = MF->begin();
MachineBasicBlock *Entry = &*MF->begin();
ReversePostOrderTraversal<MachineBasicBlock*> RPOT(Entry);
SmallVector<MachineBasicBlock*, 16> Loops;
for (ReversePostOrderTraversal<MachineBasicBlock*>::rpo_iterator