llvm-project
5e4b5864 - [DWARFLinker] Differentiate unit-local functions sharing a linkage name (#247763)

Commit
5 hours ago
[DWARFLinker] Differentiate unit-local functions sharing a linkage name (#247763) The parallel linker uniques a function by its linkage name. That name is unique across units only if the function is external. Two units can each have a static init(), or instantiate a template over their own lambda, and get the same mangled name for different functions. They were merged into one DIE, and .debug_names kept an entry per unit: ``` error: Name Index @ 0x0: Entry @ 0x18a: mismatched Name of DIE @ 0x226: index - call<(lambda at b.cpp:5:12)>; debug_info - call<(lambda at a.cpp:2:46)>, call, _Z4callIZL4initvE3$_0EiRT_. ``` For a function that is not external, add the declaration file and line and the template arguments to the name. Copies of one static inline function from a header still merge. An external function whose DW_AT_name differs between units still gets an index entry per name. The test keeps a FIXME for it. rdar://184766755 Assisted-by: Claude
Author
Parents
Loading