1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00

SelectionDAG: Avoid implicit iterator conversions in FastISel, NFC

llvm-svn: 274899
This commit is contained in:
Duncan P. N. Exon Smith 2016-07-08 18:36:41 +00:00
parent 4c303e2448
commit eabf729ace

View File

@ -353,7 +353,8 @@ void FastISel::recomputeInsertPt() {
void FastISel::removeDeadCode(MachineBasicBlock::iterator I, void FastISel::removeDeadCode(MachineBasicBlock::iterator I,
MachineBasicBlock::iterator E) { MachineBasicBlock::iterator E) {
assert(I && E && std::distance(I, E) > 0 && "Invalid iterator!"); assert(static_cast<MachineInstr *>(I) && static_cast<MachineInstr *>(E) &&
std::distance(I, E) > 0 && "Invalid iterator!");
while (I != E) { while (I != E) {
MachineInstr *Dead = &*I; MachineInstr *Dead = &*I;
++I; ++I;
@ -374,7 +375,7 @@ FastISel::SavePoint FastISel::enterLocalValueArea() {
void FastISel::leaveLocalValueArea(SavePoint OldInsertPt) { void FastISel::leaveLocalValueArea(SavePoint OldInsertPt) {
if (FuncInfo.InsertPt != FuncInfo.MBB->begin()) if (FuncInfo.InsertPt != FuncInfo.MBB->begin())
LastLocalValue = std::prev(FuncInfo.InsertPt); LastLocalValue = &*std::prev(FuncInfo.InsertPt);
// Restore the previous insert position. // Restore the previous insert position.
FuncInfo.InsertPt = OldInsertPt.InsertPt; FuncInfo.InsertPt = OldInsertPt.InsertPt;
@ -2075,7 +2076,7 @@ bool FastISel::handlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB) {
FuncInfo.PHINodesToUpdate.resize(FuncInfo.OrigNumPHINodesToUpdate); FuncInfo.PHINodesToUpdate.resize(FuncInfo.OrigNumPHINodesToUpdate);
return false; return false;
} }
FuncInfo.PHINodesToUpdate.push_back(std::make_pair(MBBI++, Reg)); FuncInfo.PHINodesToUpdate.push_back(std::make_pair(&*MBBI++, Reg));
DbgLoc = DebugLoc(); DbgLoc = DebugLoc();
} }
} }