diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 46c4ed223509..8b5f982f81f5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -181,7 +181,7 @@ void DebugLocDwarfExpression::emitBaseTypeRef(uint64_t Idx) { } bool DebugLocDwarfExpression::isFrameRegister(const TargetRegisterInfo &TRI, - unsigned MachineReg) { + llvm::Register MachineReg) { // This information is not available while emitting .debug_loc entries. return false; } diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp index 9f111dc30f76..59ad7646ce1c 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp @@ -97,7 +97,8 @@ void DwarfExpression::addAnd(unsigned Mask) { } bool DwarfExpression::addMachineReg(const TargetRegisterInfo &TRI, - unsigned MachineReg, unsigned MaxSize) { + llvm::Register MachineReg, + unsigned MaxSize) { if (!llvm::Register::isPhysicalRegister(MachineReg)) { if (isFrameRegister(TRI, MachineReg)) { DwarfRegs.push_back(Register::createRegister(-1, nullptr)); @@ -248,7 +249,7 @@ void DwarfExpression::addConstantFP(const APFloat &APF, const AsmPrinter &AP) { bool DwarfExpression::addMachineRegExpression(const TargetRegisterInfo &TRI, DIExpressionCursor &ExprCursor, - unsigned MachineReg, + llvm::Register MachineReg, unsigned FragmentOffsetInBits) { auto Fragment = ExprCursor.getFragmentInfo(); if (!addMachineReg(TRI, MachineReg, Fragment ? Fragment->SizeInBits : ~1U)) { diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h index 78a98a61178f..8fca9f5a630b 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h @@ -218,7 +218,7 @@ protected: /// Return whether the given machine register is the frame register in the /// current function. virtual bool isFrameRegister(const TargetRegisterInfo &TRI, - unsigned MachineReg) = 0; + llvm::Register MachineReg) = 0; /// Emit a DW_OP_reg operation. Note that this is only legal inside a DWARF /// register location description. @@ -245,7 +245,7 @@ protected: /// multiple subregisters that alias the register. /// /// \return false if no DWARF register exists for MachineReg. - bool addMachineReg(const TargetRegisterInfo &TRI, unsigned MachineReg, + bool addMachineReg(const TargetRegisterInfo &TRI, llvm::Register MachineReg, unsigned MaxSize = ~1U); /// Emit a DW_OP_piece or DW_OP_bit_piece operation for a variable fragment. @@ -325,7 +325,8 @@ public: /// \return false if no DWARF register exists /// for MachineReg. bool addMachineRegExpression(const TargetRegisterInfo &TRI, - DIExpressionCursor &Expr, unsigned MachineReg, + DIExpressionCursor &Expr, + llvm::Register MachineReg, unsigned FragmentOffsetInBits = 0); /// Begin emission of an entry value dwarf operation. The entry value's @@ -388,7 +389,7 @@ class DebugLocDwarfExpression final : public DwarfExpression { void commitTemporaryBuffer() override; bool isFrameRegister(const TargetRegisterInfo &TRI, - unsigned MachineReg) override; + llvm::Register MachineReg) override; public: DebugLocDwarfExpression(unsigned DwarfVersion, BufferByteStreamer &BS, @@ -418,7 +419,7 @@ class DIEDwarfExpression final : public DwarfExpression { void commitTemporaryBuffer() override; bool isFrameRegister(const TargetRegisterInfo &TRI, - unsigned MachineReg) override; + llvm::Register MachineReg) override; public: DIEDwarfExpression(const AsmPrinter &AP, DwarfCompileUnit &CU, DIELoc &DIE); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 082fffbb9a08..a74ee0f736a4 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -83,7 +83,7 @@ unsigned DIEDwarfExpression::getTemporaryBufferSize() { void DIEDwarfExpression::commitTemporaryBuffer() { OutDIE.takeValues(TmpDIE); } bool DIEDwarfExpression::isFrameRegister(const TargetRegisterInfo &TRI, - unsigned MachineReg) { + llvm::Register MachineReg) { return MachineReg == TRI.getFrameRegister(*AP.MF); }