@@ -1044,11 +1044,9 @@ SparcTargetLowering::LowerCall_32(TargetLowering::CallLoweringInfo &CLI,
10441044 // The InGlue in necessary since all emitted instructions must be
10451045 // stuck together.
10461046 SDValue InGlue;
1047- for (unsigned i = 0 , e = RegsToPass.size (); i != e; ++i) {
1048- Register Reg = RegsToPass[i].first ;
1049- if (!isTailCall)
1050- Reg = toCallerWindow (Reg);
1051- Chain = DAG.getCopyToReg (Chain, dl, Reg, RegsToPass[i].second , InGlue);
1047+ for (const auto [OrigReg, N] : RegsToPass) {
1048+ Register Reg = isTailCall ? OrigReg : toCallerWindow (OrigReg);
1049+ Chain = DAG.getCopyToReg (Chain, dl, Reg, N, InGlue);
10521050 InGlue = Chain.getValue (1 );
10531051 }
10541052
@@ -1069,11 +1067,9 @@ SparcTargetLowering::LowerCall_32(TargetLowering::CallLoweringInfo &CLI,
10691067 Ops.push_back (Callee);
10701068 if (hasStructRetAttr)
10711069 Ops.push_back (DAG.getTargetConstant (SRetArgSize, dl, MVT::i32 ));
1072- for (unsigned i = 0 , e = RegsToPass.size (); i != e; ++i) {
1073- Register Reg = RegsToPass[i].first ;
1074- if (!isTailCall)
1075- Reg = toCallerWindow (Reg);
1076- Ops.push_back (DAG.getRegister (Reg, RegsToPass[i].second .getValueType ()));
1070+ for (const auto [OrigReg, N] : RegsToPass) {
1071+ Register Reg = isTailCall ? OrigReg : toCallerWindow (OrigReg);
1072+ Ops.push_back (DAG.getRegister (Reg, N.getValueType ()));
10771073 }
10781074
10791075 // Add a register mask operand representing the call-preserved registers.
@@ -1375,9 +1371,8 @@ SparcTargetLowering::LowerCall_64(TargetLowering::CallLoweringInfo &CLI,
13751371 // necessary since all emitted instructions must be stuck together in order
13761372 // to pass the live physical registers.
13771373 SDValue InGlue;
1378- for (unsigned i = 0 , e = RegsToPass.size (); i != e; ++i) {
1379- Chain = DAG.getCopyToReg (Chain, DL,
1380- RegsToPass[i].first , RegsToPass[i].second , InGlue);
1374+ for (const auto [Reg, N] : RegsToPass) {
1375+ Chain = DAG.getCopyToReg (Chain, DL, Reg, N, InGlue);
13811376 InGlue = Chain.getValue (1 );
13821377 }
13831378
@@ -1395,9 +1390,8 @@ SparcTargetLowering::LowerCall_64(TargetLowering::CallLoweringInfo &CLI,
13951390 SmallVector<SDValue, 8 > Ops;
13961391 Ops.push_back (Chain);
13971392 Ops.push_back (Callee);
1398- for (unsigned i = 0 , e = RegsToPass.size (); i != e; ++i)
1399- Ops.push_back (DAG.getRegister (RegsToPass[i].first ,
1400- RegsToPass[i].second .getValueType ()));
1393+ for (const auto [Reg, N] : RegsToPass)
1394+ Ops.push_back (DAG.getRegister (Reg, N.getValueType ()));
14011395
14021396 // Add a register mask operand representing the call-preserved registers.
14031397 const SparcRegisterInfo *TRI = Subtarget->getRegisterInfo ();
0 commit comments