[llvm] [DebugInfo] Don't set prologue_end behind line-zero call insts (PR #156850)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 4 09:11:58 PDT 2025
================
@@ -0,0 +1,129 @@
+# RUN: llc %s -start-after=livedebugvalues -o - -filetype=obj | llvm-dwarfdump - --debug-line | FileCheck %s --implicit-check-not=prologue_end
+#
+## Original code, compiled clang -O2 -g -c
+##
+## void ext();
+## int main(int argc, char **argv) {
+## if (argc == 1)
+## ext();
+## else
+## ext();
+## return 0;
+## }
+##
+## In the code sequence above, the call to ext is given line zero during
+## optimisation, because the code is duplicated down all function paths thus
+## gets merged. We get something like this as the output:
+##
+## 0: 50 push %rax
+## 1: 31 c0 xor %eax,%eax
+## 3: e8 00 00 00 00 call 8 <main+0x8>
+## 4: R_X86_64_PLT32 ext-0x4
----------------
SLTozer wrote:
```suggestion
## 4: R_X86_64_PLT32 ext-0x4
```
https://github.com/llvm/llvm-project/pull/156850
More information about the llvm-commits
mailing list