forked from OSchip/llvm-project
AsmPrinter/Dwarf*: Use llvm::Register instead of unsigned
This commit is contained in:
parent
b1878b4641
commit
ee4769687d
|
@ -181,7 +181,7 @@ void DebugLocDwarfExpression::emitBaseTypeRef(uint64_t Idx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DebugLocDwarfExpression::isFrameRegister(const TargetRegisterInfo &TRI,
|
bool DebugLocDwarfExpression::isFrameRegister(const TargetRegisterInfo &TRI,
|
||||||
unsigned MachineReg) {
|
llvm::Register MachineReg) {
|
||||||
// This information is not available while emitting .debug_loc entries.
|
// This information is not available while emitting .debug_loc entries.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,8 @@ void DwarfExpression::addAnd(unsigned Mask) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DwarfExpression::addMachineReg(const TargetRegisterInfo &TRI,
|
bool DwarfExpression::addMachineReg(const TargetRegisterInfo &TRI,
|
||||||
unsigned MachineReg, unsigned MaxSize) {
|
llvm::Register MachineReg,
|
||||||
|
unsigned MaxSize) {
|
||||||
if (!llvm::Register::isPhysicalRegister(MachineReg)) {
|
if (!llvm::Register::isPhysicalRegister(MachineReg)) {
|
||||||
if (isFrameRegister(TRI, MachineReg)) {
|
if (isFrameRegister(TRI, MachineReg)) {
|
||||||
DwarfRegs.push_back(Register::createRegister(-1, nullptr));
|
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,
|
bool DwarfExpression::addMachineRegExpression(const TargetRegisterInfo &TRI,
|
||||||
DIExpressionCursor &ExprCursor,
|
DIExpressionCursor &ExprCursor,
|
||||||
unsigned MachineReg,
|
llvm::Register MachineReg,
|
||||||
unsigned FragmentOffsetInBits) {
|
unsigned FragmentOffsetInBits) {
|
||||||
auto Fragment = ExprCursor.getFragmentInfo();
|
auto Fragment = ExprCursor.getFragmentInfo();
|
||||||
if (!addMachineReg(TRI, MachineReg, Fragment ? Fragment->SizeInBits : ~1U)) {
|
if (!addMachineReg(TRI, MachineReg, Fragment ? Fragment->SizeInBits : ~1U)) {
|
||||||
|
|
|
@ -218,7 +218,7 @@ protected:
|
||||||
/// Return whether the given machine register is the frame register in the
|
/// Return whether the given machine register is the frame register in the
|
||||||
/// current function.
|
/// current function.
|
||||||
virtual bool isFrameRegister(const TargetRegisterInfo &TRI,
|
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
|
/// Emit a DW_OP_reg operation. Note that this is only legal inside a DWARF
|
||||||
/// register location description.
|
/// register location description.
|
||||||
|
@ -245,7 +245,7 @@ protected:
|
||||||
/// multiple subregisters that alias the register.
|
/// multiple subregisters that alias the register.
|
||||||
///
|
///
|
||||||
/// \return false if no DWARF register exists for MachineReg.
|
/// \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);
|
unsigned MaxSize = ~1U);
|
||||||
|
|
||||||
/// Emit a DW_OP_piece or DW_OP_bit_piece operation for a variable fragment.
|
/// 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
|
/// \return false if no DWARF register exists
|
||||||
/// for MachineReg.
|
/// for MachineReg.
|
||||||
bool addMachineRegExpression(const TargetRegisterInfo &TRI,
|
bool addMachineRegExpression(const TargetRegisterInfo &TRI,
|
||||||
DIExpressionCursor &Expr, unsigned MachineReg,
|
DIExpressionCursor &Expr,
|
||||||
|
llvm::Register MachineReg,
|
||||||
unsigned FragmentOffsetInBits = 0);
|
unsigned FragmentOffsetInBits = 0);
|
||||||
|
|
||||||
/// Begin emission of an entry value dwarf operation. The entry value's
|
/// Begin emission of an entry value dwarf operation. The entry value's
|
||||||
|
@ -388,7 +389,7 @@ class DebugLocDwarfExpression final : public DwarfExpression {
|
||||||
void commitTemporaryBuffer() override;
|
void commitTemporaryBuffer() override;
|
||||||
|
|
||||||
bool isFrameRegister(const TargetRegisterInfo &TRI,
|
bool isFrameRegister(const TargetRegisterInfo &TRI,
|
||||||
unsigned MachineReg) override;
|
llvm::Register MachineReg) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DebugLocDwarfExpression(unsigned DwarfVersion, BufferByteStreamer &BS,
|
DebugLocDwarfExpression(unsigned DwarfVersion, BufferByteStreamer &BS,
|
||||||
|
@ -418,7 +419,7 @@ class DIEDwarfExpression final : public DwarfExpression {
|
||||||
void commitTemporaryBuffer() override;
|
void commitTemporaryBuffer() override;
|
||||||
|
|
||||||
bool isFrameRegister(const TargetRegisterInfo &TRI,
|
bool isFrameRegister(const TargetRegisterInfo &TRI,
|
||||||
unsigned MachineReg) override;
|
llvm::Register MachineReg) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DIEDwarfExpression(const AsmPrinter &AP, DwarfCompileUnit &CU, DIELoc &DIE);
|
DIEDwarfExpression(const AsmPrinter &AP, DwarfCompileUnit &CU, DIELoc &DIE);
|
||||||
|
|
|
@ -83,7 +83,7 @@ unsigned DIEDwarfExpression::getTemporaryBufferSize() {
|
||||||
void DIEDwarfExpression::commitTemporaryBuffer() { OutDIE.takeValues(TmpDIE); }
|
void DIEDwarfExpression::commitTemporaryBuffer() { OutDIE.takeValues(TmpDIE); }
|
||||||
|
|
||||||
bool DIEDwarfExpression::isFrameRegister(const TargetRegisterInfo &TRI,
|
bool DIEDwarfExpression::isFrameRegister(const TargetRegisterInfo &TRI,
|
||||||
unsigned MachineReg) {
|
llvm::Register MachineReg) {
|
||||||
return MachineReg == TRI.getFrameRegister(*AP.MF);
|
return MachineReg == TRI.getFrameRegister(*AP.MF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue