[llvm] [DebugInfo][DWARF] Emit Per-Function Line Table Offsets and End Sequences (PR #110192)
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 11 12:55:10 PST 2024
================
@@ -527,6 +527,14 @@ DIE &DwarfCompileUnit::updateSubprogramScopeDIE(const DISubprogram *SP) {
*DD->getCurrentFunction()))
addFlag(*SPDie, dwarf::DW_AT_APPLE_omit_frame_ptr);
+ if (Asm->OutStreamer->getGenerateFuncLineTableOffsets() &&
+ Asm->OutStreamer->getCurrentFuncFirstLineStreamSym()) {
+ addSectionLabel(
+ *SPDie, dwarf::DW_AT_LLVM_stmt_sequence,
+ Asm->OutStreamer->getCurrentFuncFirstLineStreamSym(),
+ Asm->getObjFileLowering().getDwarfLineSection()->getBeginSymbol());
+ }
----------------
dwblaikie wrote:
This feedback still seems relevant, to me, to the current version of the code - it's still strange to me that MCStreamer needs to know about this with an attribute up-front with 'setGenerateFuncLineTableOffsets` - in assembly that isn't necessary, the asm directive is used wherever needed, and MCStreamer behaves appropriately/as needed (it's not like we needed a directive at the start of the file to announce that we might use line table offset directives later in the file - so why would we need that at the API level? We should just query for line table offsets when we need them and MCStreamer should provide them at that point, without needing some prior warning/up front thing)
https://github.com/llvm/llvm-project/pull/110192
More information about the llvm-commits
mailing list