[llvm] [MC][DebugInfo] Emit linetable entries with known offsets immediately (PR #134677)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 12 20:00:49 PDT 2025


================
@@ -462,6 +462,24 @@ void MCObjectStreamer::emitDwarfAdvanceLineAddr(int64_t LineDelta,
                          Label, PointerSize);
     return;
   }
+
+  // If the two labels are within the same fragment and it's a plain data
+  // fragment, then the address-offset is already a fixed constant and is not
+  // relaxable. Emit the advance-line-addr data immediately to save time and
+  // memory.
+  // As per commit bbea64250f6548, RISCV always desires symbolic relocations.
----------------
MaskRay wrote:

Perhaps use `absoluteSymbolDiff` and remove the `isRISCV` check. I've improved  `absoluteSymbolDiff` and you may need to rebase

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


More information about the llvm-commits mailing list