Open tianqingw opened 1 month ago
@llvm/issue-subscribers-debuginfo
Author: Tianqing Wang (tianqingw)
There's some discussion in the DWARF Committee on an issue related to how to represent some of these sort of situations I think - so probably best to see how that settles out before making changes here.
Reproducer: Godbolt
In the reproducer, both GCC and Clang do partial inlining for
foo()
, but they generate different debug info for the outlined function:GCC
Clang
I'm not sure whether we should take GCC's emission as standard. But a nice property of it is that one can easily infer the name of the source function from
DW_AT_abstract_origin
, while with the Clang debug info, the only way doing this is decoding the mangled name.The same issue may also be applicable for other optimizations using CodeExtractor (e.g. HotColdSplitting).