@@ -4445,11 +4445,11 @@ SDValue PPCTargetLowering::LowerFormalArguments_32SVR4(
4445
4445
// The fixed integer arguments of a variadic function are stored to the
4446
4446
// VarArgsFrameIndex on the stack so that they may be loaded by
4447
4447
// dereferencing the result of va_next.
4448
- for (unsigned GPRIndex = 0; GPRIndex != NumGPArgRegs; ++GPRIndex ) {
4448
+ for (MCPhysReg GPArgReg : GPArgRegs ) {
4449
4449
// Get an existing live-in vreg, or add a new one.
4450
- Register VReg = MF.getRegInfo().getLiveInVirtReg(GPArgRegs[GPRIndex] );
4450
+ Register VReg = MF.getRegInfo().getLiveInVirtReg(GPArgReg );
4451
4451
if (!VReg)
4452
- VReg = MF.addLiveIn(GPArgRegs[GPRIndex] , &PPC::GPRCRegClass);
4452
+ VReg = MF.addLiveIn(GPArgReg , &PPC::GPRCRegClass);
4453
4453
4454
4454
SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
4455
4455
SDValue Store =
@@ -4549,13 +4549,13 @@ SDValue PPCTargetLowering::LowerFormalArguments_64SVR4(
4549
4549
unsigned NumBytes = LinkageSize;
4550
4550
unsigned AvailableFPRs = Num_FPR_Regs;
4551
4551
unsigned AvailableVRs = Num_VR_Regs;
4552
- for (unsigned i = 0, e = Ins.size(); i != e; ++i ) {
4553
- if (Ins[i] .Flags.isNest())
4552
+ for (const ISD::InputArg &In : Ins) {
4553
+ if (In .Flags.isNest())
4554
4554
continue;
4555
4555
4556
- if (CalculateStackSlotUsed(Ins[i] .VT, Ins[i] .ArgVT, Ins[i] .Flags,
4557
- PtrByteSize, LinkageSize, ParamAreaSize,
4558
- NumBytes, AvailableFPRs, AvailableVRs))
4556
+ if (CalculateStackSlotUsed(In .VT, In .ArgVT, In .Flags, PtrByteSize ,
4557
+ LinkageSize, ParamAreaSize, NumBytes ,
4558
+ AvailableFPRs, AvailableVRs))
4559
4559
HasParameterArea = true;
4560
4560
}
4561
4561
@@ -5766,9 +5766,8 @@ buildCallOperands(SmallVectorImpl<SDValue> &Ops,
5766
5766
5767
5767
// Add argument registers to the end of the list so that they are known live
5768
5768
// into the call.
5769
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i)
5770
- Ops.push_back(DAG.getRegister(RegsToPass[i].first,
5771
- RegsToPass[i].second.getValueType()));
5769
+ for (const auto [Reg, N] : RegsToPass)
5770
+ Ops.push_back(DAG.getRegister(Reg, N.getValueType()));
5772
5771
5773
5772
// We cannot add R2/X2 as an operand here for PATCHPOINT, because there is
5774
5773
// no way to mark dependencies as implicit here.
@@ -6191,9 +6190,8 @@ SDValue PPCTargetLowering::LowerCall_32SVR4(
6191
6190
// Build a sequence of copy-to-reg nodes chained together with token chain
6192
6191
// and flag operands which copy the outgoing args into the appropriate regs.
6193
6192
SDValue InGlue;
6194
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
6195
- Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first,
6196
- RegsToPass[i].second, InGlue);
6193
+ for (const auto [Reg, N] : RegsToPass) {
6194
+ Chain = DAG.getCopyToReg(Chain, dl, Reg, N, InGlue);
6197
6195
InGlue = Chain.getValue(1);
6198
6196
}
6199
6197
@@ -6805,9 +6803,8 @@ SDValue PPCTargetLowering::LowerCall_64SVR4(
6805
6803
// Build a sequence of copy-to-reg nodes chained together with token chain
6806
6804
// and flag operands which copy the outgoing args into the appropriate regs.
6807
6805
SDValue InGlue;
6808
- for (unsigned i = 0, e = RegsToPass.size(); i != e; ++i) {
6809
- Chain = DAG.getCopyToReg(Chain, dl, RegsToPass[i].first,
6810
- RegsToPass[i].second, InGlue);
6806
+ for (const auto [Reg, N] : RegsToPass) {
6807
+ Chain = DAG.getCopyToReg(Chain, dl, Reg, N, InGlue);
6811
6808
InGlue = Chain.getValue(1);
6812
6809
}
6813
6810
0 commit comments