llvm-project/llvm/lib/CodeGen/AsmPrinter
David Stenberg 6d857166d2 [DebugInfo] Describe call site values for chains of expression producing instrs
Summary:
If the describeLoadedValue() hook produced a DIExpression when
describing a instruction, and it was not possible to emit a call site
entry directly (the value operand was not an immediate nor a preserved
register), then that described value could not be inserted into the
worklist, and would instead be dropped, meaning that the parameter's
call site value couldn't be described.

This patch extends the worklist so that each entry has an DIExpression
that is built up when iterating through the instructions.

This allows us to describe instruction chains like this:

  $reg0 = mv $fp
  $reg0 = add $reg0, offset
  call @call_with_offseted_fp

Since DW_OP_LLVM_entry_value operations can't be combined with any other
expression, such call site entries will not be emitted. I have added a
test, dbgcall-site-expr-entry-value.mir, which verifies that we don't
assert or emit broken DWARF in such cases.

Reviewers: djtodoro, aprantl, vsk

Reviewed By: djtodoro, vsk

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

Differential Revision: https://reviews.llvm.org/D75036
2020-02-27 11:18:51 +01:00
..
ARMException.cpp [MC] De-capitalize another set of MCStreamer::Emit* functions 2020-02-14 19:26:52 -08:00
AccelTable.cpp [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
AddressPool.cpp [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
AddressPool.h DebugInfo: Use assembly label arithmetic for address pool size for easier reading/editing 2019-01-24 03:27:57 +00:00
AsmPrinter.cpp [MC] De-capitalize MCStreamer::Emit{Bundle,Addrsig}* etc 2020-02-15 09:11:48 -08:00
AsmPrinterDwarf.cpp Support emitting .cfi_undefined in CodeGen 2020-02-25 14:00:01 -05:00
AsmPrinterInlineAsm.cpp [MC] De-capitalize MCStreamer::Emit{Bundle,Addrsig}* etc 2020-02-15 09:11:48 -08:00
ByteStreamer.h [AsmPrinter] De-capitalize some AsmPrinter::Emit* functions 2020-02-13 13:38:33 -08:00
CMakeLists.txt [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CodeViewDebug.cpp [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
CodeViewDebug.h Revert d91ed80 "[codeview] Reference types in type parent scopes" 2019-11-08 11:30:33 +01:00
DIE.cpp [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
DIEHash.cpp DebugInfo: Simplify emitDebugLocEntry by never passing a null CU 2020-02-03 18:47:14 -08:00
DIEHash.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DIEHashAttributes.def
DbgEntityHistoryCalculator.cpp [OPT-DBG] Teach DbgEntityHistoryCalculator about meta-instructions. 2019-12-20 14:03:34 +00:00
DebugHandlerBase.cpp [MC] De-capitalize another set of MCStreamer::Emit* functions 2020-02-14 19:26:52 -08:00
DebugLocEntry.h [WebAssembly] Use TargetIndex operands in DbgValue to track WebAssembly operands locations 2019-12-20 14:39:05 -08:00
DebugLocStream.cpp hwasan: add tag_offset DWARF attribute to optimized debug info 2019-12-12 16:18:54 -08:00
DebugLocStream.h hwasan: add tag_offset DWARF attribute to optimized debug info 2019-12-12 16:18:54 -08:00
DwarfCFIException.cpp [AsmPrinter][MCStreamer] De-capitalize EmitInstruction and EmitCFI* 2020-02-13 22:08:55 -08:00
DwarfCompileUnit.cpp [MC] De-capitalize another set of MCStreamer::Emit* functions 2020-02-14 19:26:52 -08:00
DwarfCompileUnit.h Reland (again): [DWARF] Allow cross-CU references of subprogram definitions 2020-01-27 10:52:34 -08:00
DwarfDebug.cpp [DebugInfo] Describe call site values for chains of expression producing instrs 2020-02-27 11:18:51 +01:00
DwarfDebug.h Revert "Reland "[DebugInfo] Enable the debug entry values feature by default"" 2020-02-20 14:41:39 +01:00
DwarfException.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfExpression.cpp Run clang-format on DwarfExpression (NFC) 2020-01-29 10:23:12 -08:00
DwarfExpression.h Run clang-format on DwarfExpression (NFC) 2020-01-29 10:23:12 -08:00
DwarfFile.cpp [MC] De-capitalize another set of MCStreamer::Emit* functions 2020-02-14 19:26:52 -08:00
DwarfFile.h Reapply "NFC: DebugInfo: Refactor RangeSpanList to be a struct, like DebugLocStream::List" 2019-12-18 16:28:19 -08:00
DwarfStringPool.cpp [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
DwarfStringPool.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DwarfUnit.cpp [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
DwarfUnit.h DebugInfo: Move loclist base address from DwarfFile to DebugLocStream 2019-10-17 23:02:19 +00:00
EHStreamer.cpp [MC] De-capitalize another set of MCStreamer::Emit* functions 2020-02-14 19:26:52 -08:00
EHStreamer.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ErlangGCPrinter.cpp [AsmPrinter] De-capitalize all AsmPrinter::Emit* but EmitInstruction 2020-02-13 17:06:24 -08:00
LLVMBuild.txt [Remarks] Add string deduplication using a string table 2019-04-24 00:06:24 +00:00
OcamlGCPrinter.cpp [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
WasmException.cpp [MC] De-capitalize another set of MCStreamer::Emit* functions 2020-02-14 19:26:52 -08:00
WasmException.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
WinCFGuard.cpp [WinCFG] Handle constant casts carefully in .gfids emission 2019-11-01 13:32:03 -07:00
WinCFGuard.h Add Windows Control Flow Guard checks (/guard:cf). 2019-10-28 15:19:39 +00:00
WinException.cpp [MCStreamer] De-capitalize EmitValue EmitIntValue{,InHex} 2020-02-14 23:08:40 -08:00
WinException.h [AArch64][Windows] Compute function length correctly in unwind tables. 2019-05-03 00:10:45 +00:00