summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-10-09 21:08:19 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-10-09 21:08:19 +0000
commit6e98cd32dce336ebac8382b00f4a03a5a0e99651 (patch)
tree4f4daa4fdf38e018c2eb084a2fe7914886d4866a /llvm
parent3ce825ed26684e4105e6606c8862edfc713b9d3a (diff)
downloadbcm5719-llvm-6e98cd32dce336ebac8382b00f4a03a5a0e99651.tar.gz
bcm5719-llvm-6e98cd32dce336ebac8382b00f4a03a5a0e99651.zip
CodeGen: Avoid more ilist iterator implicit conversions, NFC
llvm-svn: 249903
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/CodeGen/ProcessImplicitDefs.cpp4
-rw-r--r--llvm/lib/CodeGen/PrologEpilogInserter.cpp12
-rw-r--r--llvm/lib/CodeGen/RegisterCoalescer.cpp2
-rw-r--r--llvm/lib/CodeGen/ScheduleDAGInstrs.cpp4
-rw-r--r--llvm/lib/CodeGen/ShadowStackGCLowering.cpp10
5 files changed, 16 insertions, 16 deletions
diff --git a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
index 773173b9634..d27ea2f5186 100644
--- a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
+++ b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
@@ -96,7 +96,7 @@ void ProcessImplicitDefs::processImplicitDef(MachineInstr *MI) {
// This is a physreg implicit-def.
// Look for the first instruction to use or define an alias.
- MachineBasicBlock::instr_iterator UserMI = MI;
+ MachineBasicBlock::instr_iterator UserMI = MI->getIterator();
MachineBasicBlock::instr_iterator UserE = MI->getParent()->instr_end();
bool Found = false;
for (++UserMI; UserMI != UserE; ++UserMI) {
@@ -151,7 +151,7 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &MF) {
for (MachineBasicBlock::instr_iterator MBBI = MFI->instr_begin(),
MBBE = MFI->instr_end(); MBBI != MBBE; ++MBBI)
if (MBBI->isImplicitDef())
- WorkList.insert(MBBI);
+ WorkList.insert(&*MBBI);
if (WorkList.empty())
continue;
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index fab56bcfe85..13e753692de 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -148,7 +148,7 @@ void PEI::calculateSets(MachineFunction &Fn) {
}
// Save refs to entry and return blocks.
- SaveBlocks.push_back(Fn.begin());
+ SaveBlocks.push_back(&Fn.front());
for (MachineBasicBlock &MBB : Fn) {
if (MBB.isEHFuncletEntry())
SaveBlocks.push_back(&MBB);
@@ -829,12 +829,12 @@ void PEI::replaceFrameIndices(MachineFunction &Fn) {
}
// Handle the unreachable blocks.
- for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) {
- if (Reachable.count(BB))
+ for (auto &BB : Fn) {
+ if (Reachable.count(&BB))
// Already handled in DFS traversal.
continue;
int SPAdj = 0;
- replaceFrameIndices(BB, Fn, SPAdj);
+ replaceFrameIndices(&BB, Fn, SPAdj);
}
}
@@ -967,7 +967,7 @@ PEI::scavengeFrameVirtualRegs(MachineFunction &Fn) {
// Run through the instructions and find any virtual registers.
for (MachineFunction::iterator BB = Fn.begin(),
E = Fn.end(); BB != E; ++BB) {
- RS->enterBasicBlock(BB);
+ RS->enterBasicBlock(&*BB);
int SPAdj = 0;
@@ -1028,7 +1028,7 @@ PEI::scavengeFrameVirtualRegs(MachineFunction &Fn) {
// problem because we need the spill code before I: Move I to just
// prior to J.
if (I != std::prev(J)) {
- BB->splice(J, BB, I);
+ BB->splice(J, &*BB, I);
// Before we move I, we need to prepare the RS to visit I again.
// Specifically, RS will assert if it sees uses of registers that
diff --git a/llvm/lib/CodeGen/RegisterCoalescer.cpp b/llvm/lib/CodeGen/RegisterCoalescer.cpp
index a2b03aec277..7739d64b45f 100644
--- a/llvm/lib/CodeGen/RegisterCoalescer.cpp
+++ b/llvm/lib/CodeGen/RegisterCoalescer.cpp
@@ -2898,7 +2898,7 @@ void RegisterCoalescer::joinAllIntervals() {
std::vector<MBBPriorityInfo> MBBs;
MBBs.reserve(MF->size());
for (MachineFunction::iterator I = MF->begin(), E = MF->end();I != E;++I){
- MachineBasicBlock *MBB = I;
+ MachineBasicBlock *MBB = &*I;
MBBs.push_back(MBBPriorityInfo(MBB, Loops->getLoopDepth(MBB),
JoinSplitEdges && isSplitEdge(MBB)));
}
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 39cad7f35d2..d645a418f77 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -1099,7 +1099,7 @@ static void toggleBundleKillFlag(MachineInstr *MI, unsigned Reg,
// Once we set a kill flag on an instruction, we bail out, as otherwise we
// might set it on too many operands. We will clear as many flags as we
// can though.
- MachineBasicBlock::instr_iterator Begin = MI;
+ MachineBasicBlock::instr_iterator Begin = MI->getIterator();
MachineBasicBlock::instr_iterator End = getBundleEnd(MI);
while (Begin != End) {
for (MachineOperand &MO : (--End)->operands()) {
@@ -1233,7 +1233,7 @@ void ScheduleDAGInstrs::fixupKills(MachineBasicBlock *MBB) {
toggleKillFlag(MI, MO);
DEBUG(MI->dump());
DEBUG(if (MI->getOpcode() == TargetOpcode::BUNDLE) {
- MachineBasicBlock::instr_iterator Begin = MI;
+ MachineBasicBlock::instr_iterator Begin = MI->getIterator();
MachineBasicBlock::instr_iterator End = getBundleEnd(MI);
while (++Begin != End)
DEBUG(Begin->dump());
diff --git a/llvm/lib/CodeGen/ShadowStackGCLowering.cpp b/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
index e7b2a8e72d2..878eeeed0f6 100644
--- a/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
+++ b/llvm/lib/CodeGen/ShadowStackGCLowering.cpp
@@ -112,7 +112,7 @@ public:
case 1:
// Find all 'return', 'resume', and 'unwind' instructions.
while (StateBB != StateE) {
- BasicBlock *CurBB = StateBB++;
+ BasicBlock *CurBB = &*StateBB++;
// Branches and invokes do not escape, only unwind, resume, and return
// do.
@@ -120,7 +120,7 @@ public:
if (!isa<ReturnInst>(TI) && !isa<ResumeInst>(TI))
continue;
- Builder.SetInsertPoint(TI->getParent(), TI);
+ Builder.SetInsertPoint(TI);
return &Builder;
}
@@ -163,8 +163,8 @@ public:
// Split the basic block containing the function call.
BasicBlock *CallBB = CI->getParent();
- BasicBlock *NewBB =
- CallBB->splitBasicBlock(CI, CallBB->getName() + ".cont");
+ BasicBlock *NewBB = CallBB->splitBasicBlock(
+ CI->getIterator(), CallBB->getName() + ".cont");
// Remove the unconditional branch inserted at the end of CallBB.
CallBB->getInstList().pop_back();
@@ -184,7 +184,7 @@ public:
delete CI;
}
- Builder.SetInsertPoint(RI->getParent(), RI);
+ Builder.SetInsertPoint(RI);
return &Builder;
}
}
OpenPOWER on IntegriCloud