[PATCH] D158185: [DebugInfo] Process single-location debug values in variadic form when producing DWARF

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 17 07:47:17 PDT 2023


StephenTozer created this revision.
StephenTozer added reviewers: fdeazeve, debug-info, djtodoro.
StephenTozer added a project: debug-info.
Herald added a subscriber: hiraditya.
Herald added a project: All.
StephenTozer requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Fixes issues raised on: https://reviews.llvm.org/D133926

The patch above enabled using variadic-form debug values to represent single-location, non-stack-value debug values, and a further patch made all DBG_INSTR_REFs use variadic form. Not all code paths were updated correctly to handle the new syntax however, with entry values in still expecting an expression that begins exactly `DW_OP_LLVM_entry_value, 1`.

A function already exists to select non-variadic-like expressions; this patch adds an extra function to cheaply simplify such cases to non-variadic form, which we use prior to any entry-value processing to put DBG_INSTR_REFs and DBG_VALUEs down the same code path. We also use it for a few DIExpression functions that check for whether the first element(s) of a DIExpression match a particular pattern, so that they will return the same result for `DIExpression(DW_OP_LLVM_arg, 0, <ops>)` as for `DIExpression(<ops>)`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158185

Files:
  llvm/include/llvm/IR/DebugInfoMetadata.h
  llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
  llvm/lib/IR/DebugInfoMetadata.cpp
  llvm/test/DebugInfo/X86/debug-value-list-entry-value.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158185.551127.patch
Type: text/x-patch
Size: 15575 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230817/fc7ba457/attachment.bin>


More information about the llvm-commits mailing list