From 8b7b84e99d5212fe286d0aa4e2f5d345bcd8b405 Mon Sep 17 00:00:00 2001 From: Djordje Todorovic Date: Tue, 12 May 2020 09:40:47 +0200 Subject: [PATCH] Revert "[NFC][DwarfDebug] Prefer explicit to auto type deduction" This wasn't proposed by the LLVM Style Guide. Please see https://reviews.llvm.org/D79624. This reverts commit rG2552dc5317e0. --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f53fd301..25b973e 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -652,9 +652,9 @@ static void collectCallSiteParameters(const MachineInstr *CallMI, return; auto *MBB = CallMI->getParent(); - const TargetRegisterInfo &TRI = *MF->getSubtarget().getRegisterInfo(); - const TargetInstrInfo &TII = *MF->getSubtarget().getInstrInfo(); - const TargetLowering &TLI = *MF->getSubtarget().getTargetLowering(); + const auto &TRI = MF->getSubtarget().getRegisterInfo(); + const auto &TII = MF->getSubtarget().getInstrInfo(); + const auto &TLI = MF->getSubtarget().getTargetLowering(); // Skip the call instruction. auto I = std::next(CallMI->getReverseIterator()); @@ -715,7 +715,7 @@ static void collectCallSiteParameters(const MachineInstr *CallMI, if (MO.isReg() && MO.isDef() && Register::isPhysicalRegister(MO.getReg())) { for (auto FwdReg : ForwardedRegWorklist) - if (TRI.regsOverlap(FwdReg.first, MO.getReg())) + if (TRI->regsOverlap(FwdReg.first, MO.getReg())) Defs.insert(FwdReg.first); } } @@ -743,17 +743,17 @@ static void collectCallSiteParameters(const MachineInstr *CallMI, continue; for (auto ParamFwdReg : FwdRegDefs) { - if (auto ParamValue = TII.describeLoadedValue(*I, ParamFwdReg)) { + if (auto ParamValue = TII->describeLoadedValue(*I, ParamFwdReg)) { if (ParamValue->first.isImm()) { int64_t Val = ParamValue->first.getImm(); finishCallSiteParams(Val, ParamValue->second, ForwardedRegWorklist[ParamFwdReg], Params); } else if (ParamValue->first.isReg()) { Register RegLoc = ParamValue->first.getReg(); - unsigned SP = TLI.getStackPointerRegisterToSaveRestore(); - Register FP = TRI.getFrameRegister(*MF); + unsigned SP = TLI->getStackPointerRegisterToSaveRestore(); + Register FP = TRI->getFrameRegister(*MF); bool IsSPorFP = (RegLoc == SP) || (RegLoc == FP); - if (TRI.isCalleeSavedPhysReg(RegLoc, *MF) || IsSPorFP) { + if (TRI->isCalleeSavedPhysReg(RegLoc, *MF) || IsSPorFP) { MachineLocation MLoc(RegLoc, /*IsIndirect=*/IsSPorFP); finishCallSiteParams(MLoc, ParamValue->second, ForwardedRegWorklist[ParamFwdReg], Params); -- 2.7.4