diff options
author | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2019-06-27 13:52:34 +0000 |
---|---|---|
committer | Djordje Todorovic <djordje.todorovic@rt-rk.com> | 2019-06-27 13:52:34 +0000 |
commit | a0d45058ebb39dc18cbcdcba01d11d36eca001be (patch) | |
tree | a5a1d6c8bee81c6fd5322c99ec0887959905625f /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | c692a8dc51de996eed2214379c368c93e9a5354b (diff) | |
download | llvm-a0d45058ebb39dc18cbcdcba01d11d36eca001be.zip llvm-a0d45058ebb39dc18cbcdcba01d11d36eca001be.tar.gz llvm-a0d45058ebb39dc18cbcdcba01d11d36eca001be.tar.bz2 |
[DWARF] Handle the DW_OP_entry_value operand
Add the IR and the AsmPrinter parts for handling of the DW_OP_entry_values
DWARF operation.
([11/13] Introduce the debug entry values.)
Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>
Differential Revision: https://reviews.llvm.org/D60866
llvm-svn: 364542
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 8e842f0..71bb2b0 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1999,9 +1999,9 @@ void DwarfDebug::emitDebugLocEntry(ByteStreamer &Streamer, } } -static void emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT, - const DbgValueLoc &Value, - DwarfExpression &DwarfExpr) { +void DwarfDebug::emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT, + const DbgValueLoc &Value, + DwarfExpression &DwarfExpr) { auto *DIExpr = Value.getExpression(); DIExpressionCursor ExprCursor(DIExpr); DwarfExpr.addFragmentOffset(DIExpr); @@ -2017,6 +2017,12 @@ static void emitDebugLocValue(const AsmPrinter &AP, const DIBasicType *BT, if (Location.isIndirect()) DwarfExpr.setMemoryLocationKind(); DIExpressionCursor Cursor(DIExpr); + + if (DIExpr->isEntryValue()) { + DwarfExpr.setEntryValueFlag(); + DwarfExpr.addEntryValueExpression(Cursor); + } + const TargetRegisterInfo &TRI = *AP.MF->getSubtarget().getRegisterInfo(); if (!DwarfExpr.addMachineRegExpression(TRI, Cursor, Location.getReg())) return; @@ -2048,11 +2054,11 @@ void DebugLocEntry::finalize(const AsmPrinter &AP, "fragments are expected to be sorted"); for (auto Fragment : Values) - emitDebugLocValue(AP, BT, Fragment, DwarfExpr); + DwarfDebug::emitDebugLocValue(AP, BT, Fragment, DwarfExpr); } else { assert(Values.size() == 1 && "only fragments may have >1 value"); - emitDebugLocValue(AP, BT, Value, DwarfExpr); + DwarfDebug::emitDebugLocValue(AP, BT, Value, DwarfExpr); } DwarfExpr.finalize(); } |