zig
zig copied to clipboard
Support retainedNodes in DISubprogram
Zig Version
0.13.0-dev.28+3c5e84073
Steps to Reproduce and Observed Behavior
Currently, the debug information for Subprogram doesn't include retainedNodes property. This is used to get function argument's name when generating BTF (https://github.com/llvm/llvm-project/blob/37eb9c9632fb5e82827d1a0559f2279e9a9f1969/llvm/lib/Target/BPF/BTFDebug.cpp#L1202).
BTW, clang generates the following debug information:
!10 = distinct !DISubprogram(name: "func", scope: !1, file: !1, line: 1, type: !11, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !14)
!11 = !DISubroutineType(types: !12)
!12 = !{!13, !13}
!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!14 = !{!15}
!15 = !DILocalVariable(name: "a", arg: 1, scope: !10, file: !1, line: 1, type: !13)
Expected Behavior
Contains retainedNodes in DISubprogram.