[llvm] [dsymutil] Fix linker's ODR uniquing for typedefs with different underlying types (PR #195749)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue May 5 09:53:48 PDT 2026


dwblaikie wrote:

I wouldn't mind seeing more about the problems this is addressing - for instance the description mentiones preferred names, but clang doesn't currently produce any DWARF that's dependent on preferred names so far as I know? (2ff049b12ee3fb60581835a28bf9d0acc1723f23)

While it would be possible to get the same file/line for a typedef that refers to a different underlying type (due to inclusion context, etc) - that seems pretty rare? That said, "correctly" supporting this by detecting type equivalence does seem the more robust solution than fixing it just for "most" cases (where the file and line number differ)

I /believe/ technically defining the same typedef with different definitions in different contexts is technically an ODR violation, though one that doesn't generally get diagnosed/is mostly harmless - so arguably we could push back on code like this and diagnose it (even as late as dsymutil time) but the world's probably pretty use to the status quo of being able to do this without harm.

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


More information about the llvm-commits mailing list