[llvm] [AsmPrinter][DebugNames] Implement DW_IDX_parent entries (PR #77457)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 14:12:32 PST 2024


dwblaikie wrote:

> DW_FORM_flag_present, when the entry has a parent that is not in the table (that is, the parent doesn't have a name, or isn't allowed to be in the table as per the DWARF spec). This is space-efficient, since it takes 0 bytes.

I think the DWARF spec does allow for adding un-indexed entries to the index, and specifically for unnamed entries having an entry like "(anonymous namespace)" for instance (or other anonymous names) - maybe? Hmm, can't find the words I'm thinking of off-hand... but I thought they were there. Ah, here:

> It is possible that an indexed debugging information entry has a parent that is not indexed (for example, if its parent does not have a name attribute). In such a case, a parent attribute may point to a nameless index entry (that is, one that cannot be reached from any entry in the name table), or it may point to the nearest ancestor that does have an index entry

Not suggesting we want to/need to do that, just clarifying that it's explicitly allowed by the standard - if that's useful.

Smaller encoding's are better, so I'm not exactly complaining about the use of `present`, but just in case that has unfortunate tradeoffs in some other way, there are other options.

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


More information about the llvm-commits mailing list