[llvm] [BOLT][DWARF] Add support for .debug_names (PR #81062)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 12:32:28 PST 2024


================
@@ -378,11 +377,13 @@ getUnitForOffset(DIEBuilder &Builder, DWARFContext &DWCtx,
   return nullptr;
 }
 
-uint32_t DIEBuilder::computeDIEOffset(const DWARFUnit &CU, DIE &Die,
+uint32_t DIEBuilder::computeDIEOffset(DWARFUnit &CU, DIE &Die,
----------------
ayermolo wrote:

I see your point. The reason I put adding entries here to avoid traversing all these CUs/DIEs again and wasting resources. 
I can get StringOffsetsTableContribution before the call, but I don't think it fundamentally addresses your concern. Why are we passing StrOffsetsContributionDescriptor into computeDIEOffset?

So I think the option you mentioned of renaming to something else would be the way to go. Maybe something more generic processAndFinalizeDIEs? In case down the road we add more stuff here. For example once ability to delete dies is added I think computing GDB Index will need to move out of main updatedebuginfo.

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


More information about the llvm-commits mailing list