Skip to content

Commit ac65b4c

Browse files
committed
PowerPC: Remove implicit ilist iterator conversions, NFC
llvm-svn: 250787
1 parent 3020b1b commit ac65b4c

File tree

5 files changed

+23
-27
lines changed

5 files changed

+23
-27
lines changed

llvm/lib/Target/PowerPC/PPCBranchSelector.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {
9191
unsigned FuncSize = 0;
9292
for (MachineFunction::iterator MFI = Fn.begin(), E = Fn.end(); MFI != E;
9393
++MFI) {
94-
MachineBasicBlock *MBB = MFI;
94+
MachineBasicBlock *MBB = &*MFI;
9595

9696
// The end of the previous block may have extra nops if this block has an
9797
// alignment requirement.

llvm/lib/Target/PowerPC/PPCCTRLoops.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ bool PPCCTRLoopsVerify::runOnMachineFunction(MachineFunction &MF) {
668668
// any other instructions that might clobber the ctr register.
669669
for (MachineFunction::iterator I = MF.begin(), IE = MF.end();
670670
I != IE; ++I) {
671-
MachineBasicBlock *MBB = I;
671+
MachineBasicBlock *MBB = &*I;
672672
if (!MDT->isReachableFromEntry(MBB))
673673
continue;
674674

llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -3305,7 +3305,7 @@ void PPCDAGToDAGISel::PreprocessISelDAG() {
33053305

33063306
bool MadeChange = false;
33073307
while (Position != CurDAG->allnodes_begin()) {
3308-
SDNode *N = --Position;
3308+
SDNode *N = &*--Position;
33093309
if (N->use_empty())
33103310
continue;
33113311

@@ -3989,7 +3989,7 @@ void PPCDAGToDAGISel::PeepholePPC64ZExt() {
39893989

39903990
bool MadeChange = false;
39913991
while (Position != CurDAG->allnodes_begin()) {
3992-
SDNode *N = --Position;
3992+
SDNode *N = &*--Position;
39933993
// Skip dead nodes and any non-machine opcodes.
39943994
if (N->use_empty() || !N->isMachineOpcode())
39953995
continue;
@@ -4145,7 +4145,7 @@ void PPCDAGToDAGISel::PeepholePPC64() {
41454145
++Position;
41464146

41474147
while (Position != CurDAG->allnodes_begin()) {
4148-
SDNode *N = --Position;
4148+
SDNode *N = &*--Position;
41494149
// Skip dead nodes and any non-machine opcodes.
41504150
if (N->use_empty() || !N->isMachineOpcode())
41514151
continue;

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

+16-20
Original file line numberDiff line numberDiff line change
@@ -3193,15 +3193,15 @@ PPCTargetLowering::LowerFormalArguments_64SVR4(
31933193
EVT ObjType = (ObjSize == 1 ? MVT::i8 :
31943194
(ObjSize == 2 ? MVT::i16 : MVT::i32));
31953195
Store = DAG.getTruncStore(Val.getValue(1), dl, Val, Arg,
3196-
MachinePointerInfo(FuncArg),
3197-
ObjType, false, false, 0);
3196+
MachinePointerInfo(&*FuncArg), ObjType,
3197+
false, false, 0);
31983198
} else {
31993199
// For sizes that don't fit a truncating store (3, 5, 6, 7),
32003200
// store the whole register as-is to the parameter save area
32013201
// slot.
3202-
Store = DAG.getStore(Val.getValue(1), dl, Val, FIN,
3203-
MachinePointerInfo(FuncArg),
3204-
false, false, 0);
3202+
Store =
3203+
DAG.getStore(Val.getValue(1), dl, Val, FIN,
3204+
MachinePointerInfo(&*FuncArg), false, false, 0);
32053205
}
32063206

32073207
MemOps.push_back(Store);
@@ -3228,9 +3228,9 @@ PPCTargetLowering::LowerFormalArguments_64SVR4(
32283228
SDValue Off = DAG.getConstant(j, dl, PtrVT);
32293229
Addr = DAG.getNode(ISD::ADD, dl, Off.getValueType(), Addr, Off);
32303230
}
3231-
SDValue Store = DAG.getStore(Val.getValue(1), dl, Val, Addr,
3232-
MachinePointerInfo(FuncArg, j),
3233-
false, false, 0);
3231+
SDValue Store =
3232+
DAG.getStore(Val.getValue(1), dl, Val, Addr,
3233+
MachinePointerInfo(&*FuncArg, j), false, false, 0);
32343234
MemOps.push_back(Store);
32353235
++GPR_idx;
32363236
}
@@ -3608,7 +3608,7 @@ PPCTargetLowering::LowerFormalArguments_Darwin(
36083608
SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
36093609
EVT ObjType = ObjSize == 1 ? MVT::i8 : MVT::i16;
36103610
SDValue Store = DAG.getTruncStore(Val.getValue(1), dl, Val, FIN,
3611-
MachinePointerInfo(FuncArg),
3611+
MachinePointerInfo(&*FuncArg),
36123612
ObjType, false, false, 0);
36133613
MemOps.push_back(Store);
36143614
++GPR_idx;
@@ -3631,9 +3631,9 @@ PPCTargetLowering::LowerFormalArguments_Darwin(
36313631
int FI = MFI->CreateFixedObject(PtrByteSize, ArgOffset, true);
36323632
SDValue FIN = DAG.getFrameIndex(FI, PtrVT);
36333633
SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
3634-
SDValue Store = DAG.getStore(Val.getValue(1), dl, Val, FIN,
3635-
MachinePointerInfo(FuncArg, j),
3636-
false, false, 0);
3634+
SDValue Store =
3635+
DAG.getStore(Val.getValue(1), dl, Val, FIN,
3636+
MachinePointerInfo(&*FuncArg, j), false, false, 0);
36373637
MemOps.push_back(Store);
36383638
++GPR_idx;
36393639
ArgOffset += PtrByteSize;
@@ -8130,8 +8130,7 @@ PPCTargetLowering::EmitAtomicBinary(MachineInstr *MI, MachineBasicBlock *BB,
81308130

81318131
const BasicBlock *LLVM_BB = BB->getBasicBlock();
81328132
MachineFunction *F = BB->getParent();
8133-
MachineFunction::iterator It = BB;
8134-
++It;
8133+
MachineFunction::iterator It = ++BB->getIterator();
81358134

81368135
unsigned dest = MI->getOperand(0).getReg();
81378136
unsigned ptrA = MI->getOperand(1).getReg();
@@ -8201,8 +8200,7 @@ PPCTargetLowering::EmitPartwordAtomicBinary(MachineInstr *MI,
82018200

82028201
const BasicBlock *LLVM_BB = BB->getBasicBlock();
82038202
MachineFunction *F = BB->getParent();
8204-
MachineFunction::iterator It = BB;
8205-
++It;
8203+
MachineFunction::iterator It = ++BB->getIterator();
82068204

82078205
unsigned dest = MI->getOperand(0).getReg();
82088206
unsigned ptrA = MI->getOperand(1).getReg();
@@ -8324,8 +8322,7 @@ PPCTargetLowering::emitEHSjLjSetJmp(MachineInstr *MI,
83248322
MachineRegisterInfo &MRI = MF->getRegInfo();
83258323

83268324
const BasicBlock *BB = MBB->getBasicBlock();
8327-
MachineFunction::iterator I = MBB;
8328-
++I;
8325+
MachineFunction::iterator I = ++MBB->getIterator();
83298326

83308327
// Memory Reference
83318328
MachineInstr::mmo_iterator MMOBegin = MI->memoperands_begin();
@@ -8603,8 +8600,7 @@ PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
86038600
// To "insert" these instructions we actually have to insert their
86048601
// control-flow patterns.
86058602
const BasicBlock *LLVM_BB = BB->getBasicBlock();
8606-
MachineFunction::iterator It = BB;
8607-
++It;
8603+
MachineFunction::iterator It = ++BB->getIterator();
86088604

86098605
MachineFunction *F = BB->getParent();
86108606

llvm/lib/Target/PowerPC/PPCLoopPreIncPrep.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
302302
NewPHI->addIncoming(BasePtrStart, LoopPredecessor);
303303
}
304304

305-
Instruction *InsPoint = Header->getFirstInsertionPt();
305+
Instruction *InsPoint = &*Header->getFirstInsertionPt();
306306
GetElementPtrInst *PtrInc = GetElementPtrInst::Create(
307307
I8Ty, NewPHI, BasePtrIncSCEV->getValue(),
308308
MemI->hasName() ? MemI->getName() + ".inc" : "", InsPoint);
@@ -346,7 +346,7 @@ bool PPCLoopPreIncPrep::runOnLoop(Loop *L) {
346346
cast<Instruction>(NewBasePtr)->getParent() == PtrIP->getParent())
347347
PtrIP = 0;
348348
else if (isa<PHINode>(PtrIP))
349-
PtrIP = PtrIP->getParent()->getFirstInsertionPt();
349+
PtrIP = &*PtrIP->getParent()->getFirstInsertionPt();
350350
else if (!PtrIP)
351351
PtrIP = I->second;
352352

0 commit comments

Comments
 (0)