[DebugLine] save one debug line entry for empty prologue
authorChen Zheng <czhengsz@cn.ibm.com>
Thu, 4 May 2023 04:19:28 +0000 (04:19 +0000)
committerChen Zheng <czhengsz@cn.ibm.com>
Wed, 10 May 2023 01:21:02 +0000 (01:21 +0000)
commitfb45493562be02a2898d0a97afc833a8974adb18
tree3c99c716f294eb44d71412f1509ac667918838e6
parent9a89347c74ea111fb33277370f2c8842fa1949f7
[DebugLine] save one debug line entry for empty prologue

Reland D147506 after fixing the failure in bot
https://lab.llvm.org/buildbot/#/builders/247/builds/4125

Some debuggers like DBX on AIX assume the address in debug line
entries is always incremental. But clang generates two entries (entry
for file scope line and entry for prologue end) with same address if
prologue is empty

And if the prologue is empty, seems the first debug line entry for the
function is unnecessary(i.e. removing the first entry won't impact the
behavior in GDB on Linux), so I implement this for all debuggers.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D147506
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/test/CodeGen/AArch64/GlobalISel/combine-shift-of-shifted-dbg-value-fallback.ll
llvm/test/DebugInfo/XCOFF/empty-prolog.ll
llvm/test/DebugInfo/XCOFF/explicit-section.ll
llvm/test/DebugInfo/XCOFF/function-sections.ll
llvm/test/MC/WebAssembly/debug-info.ll
llvm/test/MC/WebAssembly/debug-info64.ll