@@ -4445,11 +4445,11 @@ SDValue PPCTargetLowering::LowerFormalArguments_32SVR4(
44454445 // The fixed integer arguments of a variadic function are stored to the
44464446 // VarArgsFrameIndex on the stack so that they may be loaded by
44474447 // dereferencing the result of va_next.
4448- for (unsigned GPRIndex = 0; GPRIndex != NumGPArgRegs; ++GPRIndex ) {
4448+ for (MCPhysReg GPArgReg : GPArgRegs ) {
44494449 // 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 );
44514451 if (!VReg)
4452- VReg = MF.addLiveIn(GPArgRegs[GPRIndex] , &PPC::GPRCRegClass);
4452+ VReg = MF.addLiveIn(GPArgReg , &PPC::GPRCRegClass);
44534453
44544454 SDValue Val = DAG.getCopyFromReg(Chain, dl, VReg, PtrVT);
44554455 SDValue Store =
@@ -4549,13 +4549,13 @@ SDValue PPCTargetLowering::LowerFormalArguments_64SVR4(
45494549 unsigned NumBytes = LinkageSize;
45504550 unsigned AvailableFPRs = Num_FPR_Regs;
45514551 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())
45544554 continue;
45554555
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))
45594559 HasParameterArea = true;
45604560 }
45614561
@@ -5766,9 +5766,8 @@ buildCallOperands(SmallVectorImpl<SDValue> &Ops,
57665766
57675767 // Add argument registers to the end of the list so that they are known live
57685768 // 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()));
57725771
57735772 // We cannot add R2/X2 as an operand here for PATCHPOINT, because there is
57745773 // no way to mark dependencies as implicit here.
@@ -6191,9 +6190,8 @@ SDValue PPCTargetLowering::LowerCall_32SVR4(
61916190 // Build a sequence of copy-to-reg nodes chained together with token chain
61926191 // and flag operands which copy the outgoing args into the appropriate regs.
61936192 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);
61976195 InGlue = Chain.getValue(1);
61986196 }
61996197
@@ -6805,9 +6803,8 @@ SDValue PPCTargetLowering::LowerCall_64SVR4(
68056803 // Build a sequence of copy-to-reg nodes chained together with token chain
68066804 // and flag operands which copy the outgoing args into the appropriate regs.
68076805 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);
68116808 InGlue = Chain.getValue(1);
68126809 }
68136810
0 commit comments