Skip to content

Commit a55c857

Browse files
committed
Address review comments.
Created using spr 1.3.6-beta.1
2 parents f6a71b5 + 7a32b7e commit a55c857

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

llvm/lib/CodeGen/MIRPrinter.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,26 +558,29 @@ void MIRPrinter::convertCallSiteObjects(yaml::MachineFunction &YMF,
558558
const MachineFunction &MF,
559559
ModuleSlotTracker &MST) {
560560
const auto *TRI = MF.getSubtarget().getRegisterInfo();
561-
for (auto CSInfo : MF.getCallSitesInfo()) {
561+
for (auto CSInfoMap : MF.getCallSitesInfo()) {
562562
yaml::CallSiteInfo YmlCS;
563563
yaml::MachineInstrLoc CallLocation;
564564

565565
// Prepare instruction position.
566-
MachineBasicBlock::const_instr_iterator CallI = CSInfo.first->getIterator();
566+
MachineBasicBlock::const_instr_iterator CallI =
567+
CSInfoMap.first->getIterator();
567568
CallLocation.BlockNum = CallI->getParent()->getNumber();
568569
// Get call instruction offset from the beginning of block.
569570
CallLocation.Offset =
570571
std::distance(CallI->getParent()->instr_begin(), CallI);
571572
YmlCS.CallLocation = CallLocation;
573+
574+
auto [ArgRegPairs, CalleeTypeIds] = CSInfoMap.second;
572575
// Construct call arguments and theirs forwarding register info.
573-
for (auto ArgReg : CSInfo.second.ArgRegPairs) {
576+
for (auto ArgReg : ArgRegPairs) {
574577
yaml::CallSiteInfo::ArgRegPair YmlArgReg;
575578
YmlArgReg.ArgNo = ArgReg.ArgNo;
576579
printRegMIR(ArgReg.Reg, YmlArgReg.Reg, TRI);
577580
YmlCS.ArgForwardingRegs.emplace_back(YmlArgReg);
578581
}
579582
// Get type ids.
580-
for (auto *CalleeTypeId : CSInfo.second.CalleeTypeIds) {
583+
for (auto *CalleeTypeId : CalleeTypeIds) {
581584
YmlCS.CalleeTypeIds.push_back(CalleeTypeId->getZExtValue());
582585
}
583586
YMF.CallSitesInfo.push_back(std::move(YmlCS));

0 commit comments

Comments
 (0)