Commit 88125a0
committed
[clang][DebugInfo] Emit DW_AT_object_pointer on function definitions with explicit
We currently don't emit `DW_AT_object_pointer` on function
declarations or definitions. The DWARFv5 spec doesn't mandate
this attribute be present *only* for implicit object parameters:
```
If the member function entry describes a non-static member function,
then that entry has a DW_AT_object_pointer attribute whose value is a reference to
the formal parameter entry that corresponds to the object for which the
function is called.
That parameter also has a DW_AT_artificial attribute whose value is true.
```
The part about `DW_AT_artificial` seems overly restrictive, and not true for
explicit object parameters. We probably should relax this part of the DWARF spec.
This will help LLDB identify static vs. non-static member functions (see
#120856).
GCC suffers from the same issue: https://godbolt.org/z/h4jeT54G5
Partially fixes #120974this
1 parent 48803bc commit 88125a0
File tree
6 files changed
+39
-23
lines changed- clang
- lib/CodeGen
- test/CodeGenCXX
- llvm
- include
- llvm-c
- llvm/IR
- lib/IR
6 files changed
+39
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2016 | 2016 | | |
2017 | 2017 | | |
2018 | 2018 | | |
2019 | | - | |
2020 | | - | |
2021 | | - | |
2022 | | - | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
2023 | 2024 | | |
2024 | 2025 | | |
2025 | | - | |
| 2026 | + | |
| 2027 | + | |
2026 | 2028 | | |
2027 | 2029 | | |
2028 | 2030 | | |
2029 | 2031 | | |
2030 | 2032 | | |
2031 | 2033 | | |
2032 | 2034 | | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
2033 | 2042 | | |
2034 | 2043 | | |
2035 | 2044 | | |
| |||
5118 | 5127 | | |
5119 | 5128 | | |
5120 | 5129 | | |
5121 | | - | |
| 5130 | + | |
5122 | 5131 | | |
5123 | 5132 | | |
5124 | 5133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | | - | |
13 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
873 | | - | |
| 873 | + | |
| 874 | + | |
874 | 875 | | |
875 | 876 | | |
| 877 | + | |
| 878 | + | |
876 | 879 | | |
877 | | - | |
878 | | - | |
879 | | - | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
880 | 883 | | |
881 | 884 | | |
882 | 885 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
666 | | - | |
667 | | - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
| 647 | + | |
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
652 | 656 | | |
653 | 657 | | |
654 | 658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1432 | 1432 | | |
1433 | 1433 | | |
1434 | 1434 | | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1439 | 1440 | | |
1440 | 1441 | | |
1441 | 1442 | | |
| |||
0 commit comments