[llvm] [DWARFLinker] Patch DW_AT_LLVM_stmt_sequence in the parallel linker (PR #195388)

via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 09:52:24 PDT 2026


================
@@ -407,6 +407,25 @@ class alignas(8) CompileUnit : public DwarfUnit {
   /// Returns function ranges of this unit.
   const RangesTy &getFunctionRanges() const { return Ranges; }
 
+  /// Record that a DW_AT_LLVM_stmt_sequence attribute on this unit
+  /// references the input line-table sequence starting at \p InputFirstAddr
+  /// (std::nullopt if the input offset couldn't be resolved to an input
+  /// row). After the line table for this unit has been emitted, \p V is
+  /// rewritten to the byte offset of the output sequence that contains
+  /// the relocated address (or to an invalid sentinel if the sequence
+  /// wasn't kept).
+  void noteStmtSeqListAttribute(DIEValue *V,
+                                std::optional<uint64_t> InputFirstAddr) {
+    StmtSeqListAttributes.push_back({V, InputFirstAddr});
----------------
alx32 wrote:

Do we need to clear `StmtSeqListAttributes` when a CU is reset and cloned again? `V` seems tied to the previous clone allocator.

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


More information about the llvm-commits mailing list