[llvm] [RFC] Emit dwarf data for signature-changed or new functions (PR #157349)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 22 23:05:25 PDT 2025
yonghong-song wrote:
@dzhidzhoev I found one problem if `EmitChangedFuncDebugInfo()` logic in DwarfDebug. For example, let us say we have a function like
```
struct foo { long a; long b; long c; ... };
int bar(struct foo arg) { ... }
```
The compiler will transfer `int bar(struct foo arg)` to `int bar(struct foo *arg)`.
In the debuginfo, initially we will have
```
DICompositeType(tag: DW_TAG_structure_type, ...)
```
but we do not have a pointer type pointing to the above DICompositeType.
Eventually we want to generate a debuginfo like
```
pointer -> DICompositeType(tag: DW_TAG_structure_type, ...)
```
We can do this at current IR pass with DIBuilder.
But it will be hard to do it in DwarfDebug since in DwarfDebug, we have
```
void DwarfDebug::endFunctionImpl(const MachineFunction *MF)
```
since MF is a constant pointer, the subsequent SP is also constant.
DIBuilder needs a non-constant DIType, e.g.
```
createPointerType(DIType *PointeeTy, uint64_t SizeInBits, ...)
```
Do you have any suggestions for this?
https://github.com/llvm/llvm-project/pull/157349
More information about the llvm-commits
mailing list