Commit 568db78
committed
[CGDebugInfo] Emit subprograms for decls when AT_tail_call is understood (reland with fixes)
Currently, clang emits subprograms for declared functions when the
target debugger or DWARF standard is known to support entry values
(DW_OP_entry_value & the GNU equivalent).
Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU
tail calls.
Pre-patch debug session with a cross-TU tail call:
```
* frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt]
```
Post-patch (note that the tail-calling frame, "helper", is visible):
```
* frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
frame #1: 0x0000000100000f80 main`helper [opt] [artificial]
frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt]
```
This was reverted in 5b9a072 because it attached declaration
subprograms to inlinable builtin calls, which interacted badly with the
MergeICmps pass. The fix is to not attach declarations to builtins.
rdar://46577651
Differential Revision: https://reviews.llvm.org/D697431 parent 75b5db3 commit 568db78
File tree
6 files changed
+72
-31
lines changed- clang
- include/clang/Basic
- lib
- CodeGen
- Sema
- test
- CodeGenCXX
- CodeGen
- llvm/test/DebugInfo/X86
6 files changed
+72
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
384 | 384 | | |
385 | 385 | | |
386 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
387 | 398 | | |
388 | 399 | | |
389 | 400 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3765 | 3765 | | |
3766 | 3766 | | |
3767 | 3767 | | |
3768 | | - | |
3769 | | - | |
3770 | | - | |
| 3768 | + | |
3771 | 3769 | | |
3772 | | - | |
3773 | 3770 | | |
3774 | 3771 | | |
3775 | 3772 | | |
| 3773 | + | |
| 3774 | + | |
| 3775 | + | |
| 3776 | + | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
| 3780 | + | |
| 3781 | + | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
3776 | 3787 | | |
3777 | 3788 | | |
3778 | 3789 | | |
3779 | 3790 | | |
3780 | | - | |
3781 | | - | |
3782 | | - | |
3783 | 3791 | | |
3784 | 3792 | | |
3785 | 3793 | | |
| |||
4841 | 4849 | | |
4842 | 4850 | | |
4843 | 4851 | | |
4844 | | - | |
4845 | | - | |
| 4852 | + | |
4846 | 4853 | | |
4847 | | - | |
| 4854 | + | |
| 4855 | + | |
4848 | 4856 | | |
4849 | 4857 | | |
4850 | 4858 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
692 | 692 | | |
693 | 693 | | |
694 | 694 | | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | 695 | | |
708 | 696 | | |
709 | 697 | | |
| |||
713 | 701 | | |
714 | 702 | | |
715 | 703 | | |
716 | | - | |
| 704 | + | |
717 | 705 | | |
718 | 706 | | |
719 | 707 | | |
720 | 708 | | |
721 | 709 | | |
722 | | - | |
| 710 | + | |
723 | 711 | | |
724 | 712 | | |
725 | 713 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | | - | |
5 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
6 | 27 | | |
7 | 28 | | |
| 29 | + | |
| 30 | + | |
8 | 31 | | |
9 | | - | |
| 32 | + | |
10 | 33 | | |
11 | 34 | | |
12 | | - | |
13 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
14 | 38 | | |
15 | 39 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
| 81 | + | |
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
| |||
0 commit comments