[llvm] [DebugInfo][DWARF] Emit Per-Function Line Table Offsets and End Sequences (PR #110192)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 3 12:30:47 PDT 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());
+  }
----------------
alx32 wrote:

That sounds like a better design and I think it may work. For the current implementation - same as above - was trying to follow Apple's existing design. See [here](https://github.com/swiftlang/llvm-project/blob/601abd74df1b6cad0690397898a2bd3a27a955e1/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp#L2374) for example. 

Before taking the more straightforward approach just want to make sure we aren't necessarily weighing in Apple's existing design - and we should try to get the best design for the current feature only. 

https://github.com/llvm/llvm-project/pull/110192


More information about the llvm-commits mailing list