[llvm] [llvm-objdump] Optimize live element tracking (PR #158763)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 11:12:05 PST 2025


================
@@ -126,8 +121,18 @@ void LiveElementPrinter::addInlinedFunction(DWARFDie FuncDie,
   DWARFUnit *U = InlinedFuncDie.getDwarfUnit();
   const char *InlinedFuncName = InlinedFuncDie.getName(DINameKind::LinkageName);
   DWARFAddressRange Range{FuncLowPC, FuncHighPC, SectionIndex};
+  // Add the new element to the main vector.
   LiveElements.emplace_back(std::make_unique<InlinedFunction>(
       InlinedFuncName, U, FuncDie, InlinedFuncDie, Range));
+  // Map the element's low address (LowPC) to its pointer for fast range start
+  // lookup.
+  LiveElementsByAddress[FuncLowPC].push_back(LiveElements.back().get());
+  // Map the element's high address (HighPC) to its pointer for fast range end
+  // lookup.
+  LiveElementsByEndAddress[FuncHighPC].push_back(LiveElements.back().get());
+  // Map the pointer to its DWARF discovery index (ElementIdx) for deterministic
----------------
gulfemsavrun wrote:

Done.

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


More information about the llvm-commits mailing list