Commit 7c72941
authored
[llvm][DebugInfo] Attach object-pointer to DISubprogram declarations (llvm#122742)
Currently Clang only attaches `DW_AT_object_pointer` to
`DW_TAG_subprogram` definitions. LLDB constructs C++ method types from
their `DW_TAG_subprogram` declaration, which is also the point at which
it needs to determine whether a method is static or not. LLDB's
heuristic for this could be very simple if we emitted
`DW_AT_object_pointer` on declarations. But since we don't, LLDB has to
guess whether an argument is an implicit object parameter based on the
DW_AT_name and DW_AT_type.
To simplify LLDB's job (and to eventually support C++23's explicit
object parameters), this patch adds the `DIFlagObjectPointer` to
`DISubprogram` declarations.
For reference, GCC attaches the object-pointer DIE to both the
definition and declaration: https://godbolt.org/z/3TWjTfWon
Fixes llvm#1209731 parent ba44d7b commit 7c72941
File tree
6 files changed
+1647
-1563
lines changed- llvm
- lib/CodeGen/AsmPrinter
- test
- DebugInfo
- NVPTX
- X86
- tools/llvm-dwarfdump/X86
6 files changed
+1647
-1563
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
849 | 849 | | |
850 | 850 | | |
851 | 851 | | |
852 | | - | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
853 | 855 | | |
854 | 856 | | |
855 | 857 | | |
| |||
860 | 862 | | |
861 | 863 | | |
862 | 864 | | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
863 | 869 | | |
864 | 870 | | |
| 871 | + | |
| 872 | + | |
865 | 873 | | |
866 | 874 | | |
867 | 875 | | |
| |||
1358 | 1366 | | |
1359 | 1367 | | |
1360 | 1368 | | |
1361 | | - | |
| 1369 | + | |
| 1370 | + | |
1362 | 1371 | | |
1363 | 1372 | | |
1364 | 1373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
| |||
0 commit comments