Loading llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp +10 −9 Original line number Diff line number Diff line Loading @@ -248,8 +248,8 @@ bool DwarfExpression::addMachineRegExpression(const TargetRegisterInfo &TRI, // a call site parameter expression and if that expression is just a register // location, emit it with addBReg and offset 0, because we should emit a DWARF // expression representing a value, rather than a location. if (!isMemoryLocation() && !HasComplexExpression && (!isParameterValue() || isEntryValue())) { if (!isMemoryLocation() && !HasComplexExpression && (!isParameterValue() || isEntryValue())) { for (auto &Reg : DwarfRegs) { if (Reg.DwarfRegNo >= 0) addReg(Reg.DwarfRegNo, Reg.Comment); Loading Loading @@ -363,7 +363,8 @@ unsigned DwarfExpression::getOrCreateBaseType(unsigned BitSize, return I; } /// Assuming a well-formed expression, match "DW_OP_deref* DW_OP_LLVM_fragment?". /// Assuming a well-formed expression, match "DW_OP_deref* /// DW_OP_LLVM_fragment?". static bool isMemoryLocation(DIExpressionCursor ExprCursor) { while (ExprCursor) { auto Op = ExprCursor.take(); Loading llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h +14 −27 Original line number Diff line number Diff line Loading @@ -150,29 +150,17 @@ protected: unsigned DwarfVersion : 4; public: bool isUnknownLocation() const { return LocationKind == Unknown; } bool isUnknownLocation() const { return LocationKind == Unknown; } bool isMemoryLocation() const { return LocationKind == Memory; } bool isMemoryLocation() const { return LocationKind == Memory; } bool isRegisterLocation() const { return LocationKind == Register; } bool isRegisterLocation() const { return LocationKind == Register; } bool isImplicitLocation() const { return LocationKind == Implicit; } bool isImplicitLocation() const { return LocationKind == Implicit; } bool isEntryValue() const { return LocationFlags & EntryValue; } bool isEntryValue() const { return LocationFlags & EntryValue; } bool isParameterValue() { return LocationFlags & CallSiteParamValue; } bool isParameterValue() { return LocationFlags & CallSiteParamValue; } Optional<uint8_t> TagOffset; Loading Loading @@ -222,7 +210,8 @@ protected: /// Return whether the given machine register is the frame register in the /// current function. virtual bool isFrameRegister(const TargetRegisterInfo &TRI, unsigned MachineReg) = 0; virtual bool isFrameRegister(const TargetRegisterInfo &TRI, unsigned MachineReg) = 0; /// Emit a DW_OP_reg operation. Note that this is only legal inside a DWARF /// register location description. Loading Loading @@ -307,14 +296,10 @@ public: } /// Lock this down to become an entry value location. void setEntryValueFlag() { LocationFlags |= EntryValue; } void setEntryValueFlag() { LocationFlags |= EntryValue; } /// Lock this down to become a call site parameter location. void setCallSiteParamValueFlag() { LocationFlags |= CallSiteParamValue; } void setCallSiteParamValueFlag() { LocationFlags |= CallSiteParamValue; } /// Emit a machine register location. As an optimization this may also consume /// the prefix of a DwarfExpression if a more efficient representation for Loading Loading @@ -391,6 +376,7 @@ class DebugLocDwarfExpression final : public DwarfExpression { bool isFrameRegister(const TargetRegisterInfo &TRI, unsigned MachineReg) override; public: DebugLocDwarfExpression(unsigned DwarfVersion, BufferByteStreamer &BS, DwarfCompileUnit &CU) Loading Loading @@ -420,6 +406,7 @@ class DIEDwarfExpression final : public DwarfExpression { bool isFrameRegister(const TargetRegisterInfo &TRI, unsigned MachineReg) override; public: DIEDwarfExpression(const AsmPrinter &AP, DwarfCompileUnit &CU, DIELoc &DIE); Loading Loading
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp +10 −9 Original line number Diff line number Diff line Loading @@ -248,8 +248,8 @@ bool DwarfExpression::addMachineRegExpression(const TargetRegisterInfo &TRI, // a call site parameter expression and if that expression is just a register // location, emit it with addBReg and offset 0, because we should emit a DWARF // expression representing a value, rather than a location. if (!isMemoryLocation() && !HasComplexExpression && (!isParameterValue() || isEntryValue())) { if (!isMemoryLocation() && !HasComplexExpression && (!isParameterValue() || isEntryValue())) { for (auto &Reg : DwarfRegs) { if (Reg.DwarfRegNo >= 0) addReg(Reg.DwarfRegNo, Reg.Comment); Loading Loading @@ -363,7 +363,8 @@ unsigned DwarfExpression::getOrCreateBaseType(unsigned BitSize, return I; } /// Assuming a well-formed expression, match "DW_OP_deref* DW_OP_LLVM_fragment?". /// Assuming a well-formed expression, match "DW_OP_deref* /// DW_OP_LLVM_fragment?". static bool isMemoryLocation(DIExpressionCursor ExprCursor) { while (ExprCursor) { auto Op = ExprCursor.take(); Loading
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.h +14 −27 Original line number Diff line number Diff line Loading @@ -150,29 +150,17 @@ protected: unsigned DwarfVersion : 4; public: bool isUnknownLocation() const { return LocationKind == Unknown; } bool isUnknownLocation() const { return LocationKind == Unknown; } bool isMemoryLocation() const { return LocationKind == Memory; } bool isMemoryLocation() const { return LocationKind == Memory; } bool isRegisterLocation() const { return LocationKind == Register; } bool isRegisterLocation() const { return LocationKind == Register; } bool isImplicitLocation() const { return LocationKind == Implicit; } bool isImplicitLocation() const { return LocationKind == Implicit; } bool isEntryValue() const { return LocationFlags & EntryValue; } bool isEntryValue() const { return LocationFlags & EntryValue; } bool isParameterValue() { return LocationFlags & CallSiteParamValue; } bool isParameterValue() { return LocationFlags & CallSiteParamValue; } Optional<uint8_t> TagOffset; Loading Loading @@ -222,7 +210,8 @@ protected: /// Return whether the given machine register is the frame register in the /// current function. virtual bool isFrameRegister(const TargetRegisterInfo &TRI, unsigned MachineReg) = 0; virtual bool isFrameRegister(const TargetRegisterInfo &TRI, unsigned MachineReg) = 0; /// Emit a DW_OP_reg operation. Note that this is only legal inside a DWARF /// register location description. Loading Loading @@ -307,14 +296,10 @@ public: } /// Lock this down to become an entry value location. void setEntryValueFlag() { LocationFlags |= EntryValue; } void setEntryValueFlag() { LocationFlags |= EntryValue; } /// Lock this down to become a call site parameter location. void setCallSiteParamValueFlag() { LocationFlags |= CallSiteParamValue; } void setCallSiteParamValueFlag() { LocationFlags |= CallSiteParamValue; } /// Emit a machine register location. As an optimization this may also consume /// the prefix of a DwarfExpression if a more efficient representation for Loading Loading @@ -391,6 +376,7 @@ class DebugLocDwarfExpression final : public DwarfExpression { bool isFrameRegister(const TargetRegisterInfo &TRI, unsigned MachineReg) override; public: DebugLocDwarfExpression(unsigned DwarfVersion, BufferByteStreamer &BS, DwarfCompileUnit &CU) Loading Loading @@ -420,6 +406,7 @@ class DIEDwarfExpression final : public DwarfExpression { bool isFrameRegister(const TargetRegisterInfo &TRI, unsigned MachineReg) override; public: DIEDwarfExpression(const AsmPrinter &AP, DwarfCompileUnit &CU, DIELoc &DIE); Loading