[llvm] [CLANG][DWARF] Handle DIE offset collision in DW_IDX_parent (PR #95039)

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 11:50:30 PDT 2024


ayermolo wrote:

> Out on vacation until tomorrow, but did you try making the die numbering unique across type and compile units? I would've thought that might be simpler, but maybe had too many knock-on effects/other things that'd need fixing/changing.

I thought this would be a less intrusive change.
Unifying IDs would have brought up how to handle TUs that get discarded. We need UniqueID set for when we create entries, at which point we don't know if this CU will be discarded or not. 
There is also a question of how/where CU unique ID is used. For example it is passed into emitDwarfFile0Directive. Under the hood it access MCDwarfLineTablesCUMap. It's a map so probably fine to have non sequential IDs. On flip side code in emitDWARF5AccelTable relies on it being sequential (although fix would be super minor) So I think this is a less risky way of fixing the issue.

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


More information about the llvm-commits mailing list