OSDN Git Service

[DebugInfo] Use FrameDestroy to extend stack locations to end-of-function
authorJeremy Morse <jeremy.morse.llvm@gmail.com>
Thu, 13 Jun 2019 10:03:17 +0000 (10:03 +0000)
committerJeremy Morse <jeremy.morse.llvm@gmail.com>
Thu, 13 Jun 2019 10:03:17 +0000 (10:03 +0000)
commit534e6904ea2a183f936f3cf1e28d4648e701593f
tree7b7534a334bd40f3304b246b20ee42a70a962e11
parent7eaa42190fafffaaeaf24f2c30677cf7eb332ea0
[DebugInfo] Use FrameDestroy to extend stack locations to end-of-function

We aim to ignore changes in variable locations during the prologue and
epilogue of functions, to avoid using space documenting location changes
that aren't visible. However in D61940 / r362951 this got ripped out as
the previous implementation was unsound.

Instead, use the FrameDestroy flag to identify when we're in the epilogue
of a function, and ignore variable location changes accordingly. This fits
in with existing code that examines the FrameSetup flag.

Some variable locations get shuffled in modified tests as they now cover
greater ranges, which is what would be expected. Some additional
single-location variables are generated too. Two tests are un-xfailed,
they were only xfailed due to r362951 deleting functionality they depended
on.

Apparently some out-of-tree backends don't accurately maintain FrameDestroy
flags -- if you're an out-of-tree maintainer and see changes in variable
locations disappear due to a faulty FrameDestroy flag, it's safe to back
this change out. The impact is just slightly more debug info than necessary.

Differential Revision: https://reviews.llvm.org/D62314

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363245 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
test/DebugInfo/COFF/pieces.ll
test/DebugInfo/X86/dbg-addr.ll
test/DebugInfo/X86/debug-loc-offset.mir
test/DebugInfo/X86/pr19307.mir