[PATCH] D57510: [DebugInfo] Keep parameter DBG_VALUEs before prologue code

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 31 06:47:05 PST 2019


dstenb created this revision.
dstenb added reviewers: aprantl, dblaikie, rnk, jmorse.
dstenb added a project: debug-info.
Herald added a subscriber: llvm-commits.

This is a preparatory change for removing the code from
DebugHandlerBase::beginFunction() which changes the starting label for
the first non-overlapping DBG_VALUEs of parameters to the beginning of
the function. It does that to be able to show parameters when entering a
function. However, that code does not consider what defines the values,
which can result in the ranges for the debug values starting before
their defining instructions. That code is removed in a follow-up patch.

When prologue code is inserted, it leads to DBG_VALUEs that start
directly in the entry block being moved down after the prologue
instructions. This patch fixes that by stashing away DBG_VALUEs for
parameters before emitting the prologue, and then reinserts them at the
start of the block. This assumes that there is no target that somehow
clobbers parameter registers in the frame setup; there is no such case
in the lit tests at least.

See PR40188 for more information.


Repository:
  rL LLVM

https://reviews.llvm.org/D57510

Files:
  lib/CodeGen/PrologEpilogInserter.cpp
  test/DebugInfo/COFF/register-variables.ll
  test/DebugInfo/X86/prolog-params.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57510.184494.patch
Type: text/x-patch
Size: 12694 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190131/ca9c562a/attachment.bin>


More information about the llvm-commits mailing list