[llvm] [LLVM][DWARF] Chnage order for .debug_names abbrev print out (PR #80229)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 15:34:16 PST 2024


ayermolo wrote:

> How's this compare to how we handle .debug_abbrevs? (perhaps we could be sharing some parsing infrastructure, the same as I'm suggesting/hoping we share some generation infrastructure - but even if not shared code, bringing two different implementations into alignment so they do/express things more similarly would be good)

The DeclSet are stored in the map based on offset. Within it's a Decls vector. Looks like lookups in Decls vector is linear (iterates over it). At least in DWARFAbbreviationDeclarationSet.

Not sure how this can be replicated generically (before we switch to index) with just std::map for .debug_names abbrev. Because we need to lookup based on AbbrevTag (DWARFDebugNames::NameIndex::getEntry), but keep it sorted by offset (for llvm-dwarfdump).

Maybe we can re-visit after llvm is switched to output indices? I am finishing BOLT implementation and adding tests. So would help if llvm-dwarfdump outputs things in correct order. :)

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


More information about the llvm-commits mailing list