diff options
| author | Vedant Kumar <vsk@apple.com> | 2019-11-13 18:19:32 -0800 |
|---|---|---|
| committer | Vedant Kumar <vsk@apple.com> | 2019-11-19 12:49:27 -0800 |
| commit | 568db780bb7267651a902da8e85bc59fc89aea70 (patch) | |
| tree | ca97ced025e445f390dbe85798923daed2a3fbc6 /llvm/test/DebugInfo/X86 | |
| parent | 75b5db3094399302a1f60f5e09cf3d6ed8d161fb (diff) | |
| download | bcm5719-llvm-568db780bb7267651a902da8e85bc59fc89aea70.tar.gz bcm5719-llvm-568db780bb7267651a902da8e85bc59fc89aea70.zip | |
[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 5b9a072c 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/D69743
Diffstat (limited to 'llvm/test/DebugInfo/X86')
| -rw-r--r-- | llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll b/llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll index c37ce1eb7fb..33e06faba57 100644 --- a/llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll +++ b/llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll @@ -25,6 +25,14 @@ @sink = global i32 0, align 4, !dbg !0 +define void @__has_no_subprogram() { +entry: + %0 = load volatile i32, i32* @sink, align 4 + %inc = add nsw i32 %0, 1 + store volatile i32 %inc, i32* @sink, align 4 + ret void +} + ; ASM: DW_TAG_subprogram ; ASM: DW_AT_call_all_calls ; OBJ: [[bat_sp:.*]]: DW_TAG_subprogram @@ -70,6 +78,7 @@ entry: ; OBJ: DW_AT_call_tail_call define void @_Z3foov() !dbg !25 { entry: + tail call void @__has_no_subprogram() tail call void @_Z3barv(), !dbg !26 tail call void @_Z3batv(), !dbg !27 tail call void @_Z3barv(), !dbg !26 |

