[llvm] [RFC] Emit dwarf data for signature-changed or new functions (PR #157349)

Vladislav Dzhidzhoev via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 3 03:14:12 PDT 2025


dzhidzhoev wrote:

Could you add more tests for that?
1. A test to check what EmitChangedFuncDebugInfo produces.
2. A test to check how ArgumentPromotion pass works together with EmitChangedFuncDebugInfo (this may also be relevant for other passes that modify function signatures).
3. Would be nice to have a cross-project-test to see if lldb can handle the resulting DWARFs properly. It can check whether this problem does not appear.
> I think, having two functions with the same DW_AT_name but different formal parameters may indeed interfere with debugger name resolution: debugger users will be able to call the function with the signature not matching the signature from the source code.
Probably, DW_TAG_subprogram with the final list of parameters (`0x01c2663c:   DW_TAG_subprogram` in your example) should have DW_AT_artifical to prevent that (DW_AT_artifical can be emitted by raising DIFlagArtificial in the corresponding DISubprogram).

And I think it will be easier to review this if we have examples of LLVM IR input + expected LLVM IR or DWARF output in form of tests.

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


More information about the llvm-commits mailing list