[PATCH] D69970: [CGDebugInfo] Emit subprograms for decls when AT_tail_call is understood (reland with fixes)

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 7 14:26:17 PST 2019


vsk created this revision.
vsk added reviewers: aprantl, djtodoro, dblaikie.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Currently, clang emits subprograms for declared functions when the
target debugger or DWARF standard is known to support entry values
(DW_OP_entry_value & the GNU equivalent).

Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU
tail calls.

Pre-patch debug session with a cross-TU tail call:

  * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
    frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt]

Post-patch (note that the tail-calling frame, "helper", is visible):

  * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
    frame #1: 0x0000000100000f80 main`helper [opt] [artificial]
    frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt]

This was reverted in 5b9a072c <https://reviews.llvm.org/rG5b9a072c39c0c34a290abd19e4aca8208a9afae6> because it attached declaration
subprograms to inlinable builtin calls, which interacted badly with the
MergeICmps pass. The fix is to not attach declarations to builtins.

rdar://46577651

Previous review: https://reviews.llvm.org/D69743


https://reviews.llvm.org/D69970

Files:
  clang/lib/CodeGen/CGDebugInfo.cpp
  clang/test/CodeGen/debug-info-extern-call.c
  clang/test/CodeGenCXX/dbg-info-all-calls-described.cpp
  llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69970.228312.patch
Type: text/x-patch
Size: 5135 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191107/a39aaadd/attachment.bin>


More information about the llvm-commits mailing list