[lld] [llvm] [NFC][DebugInfo] Allow single instruction sequence in line table to make symbolication of merged functions easier (PR #154851)
Peter Rong via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 25 10:58:05 PDT 2025
DataCorrupted wrote:
> Compilers sometimes generates functions consisting of a single branch
I thought about this, and if we are to emit a nop after branch, we can assume all merged functions that requires `DW_AT_LLVM_stmt_sequence` has at least two instructions. If so, we can skip emitting `DW_AT_LLVM_stmt_sequence` for single-instruction functions, as such they will be symbolicated just fine, as if `DW_AT_LLVM_stmt_sequence` was never introduced. I've put up another draft for this: #154986
> I think the approach is good, but I cannot say if it would break things for others
Unfortunately, it is, breaking somethings in LLDB/GSYM. I don't think I can move forward until I can receive confirmation from more experienced eyes: Are these breaks are benign and can be easily fixed, or did it break some fundamental assumptions in your work?
- Some line tables that were considered illegal is now legal: `lld :: ELF/undef.s` @jh7370
- Some tests are relying on the fact that the last row can't be found:
- `LLVM :: tools/llvm-dwarfdump/X86/locstats.ll`
- `LLVM :: tools/llvm-symbolizer/symbol-search.test`
- `LLVM-Unit :: DebugInfo/GSYM/./DebugInfoGSYMTests/GSYMTest/TestDWARFNoLines` @clayborg
https://github.com/llvm/llvm-project/pull/154851
More information about the llvm-commits
mailing list