[DWARF] Emit DW_AT_call_pc for tail calls
authorVedant Kumar <vsk@apple.com>
Wed, 18 Mar 2020 00:56:28 +0000 (17:56 -0700)
committerVedant Kumar <vsk@apple.com>
Tue, 24 Mar 2020 19:01:55 +0000 (12:01 -0700)
commitf7052da6db8f85814adb2e1a6742d607e774bb88
treecebfbffb5364fff092f0f973ac4ac87511e1e6de
parentc5f4b728353313346c707ffc83f5aff90e35e71c
[DWARF] Emit DW_AT_call_pc for tail calls

Record the address of a tail-calling branch instruction within its call
site entry using DW_AT_call_pc. This allows a debugger to determine the
address to use when creating aritificial frames.

This creates an extra attribute + relocation at tail call sites, which
constitute 3-5% of all call sites in xnu/clang respectively.

rdar://60307600

Differential Revision: https://reviews.llvm.org/D76336
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/test/DebugInfo/MIR/X86/call-site-gnu-vs-dwarf5-attrs.mir
llvm/test/DebugInfo/X86/dwarf-callsite-related-attrs.ll
llvm/test/tools/dsymutil/X86/Inputs/tail-call.cpp [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/Inputs/tail-call.macho.x86_64 [new file with mode: 0755]
llvm/test/tools/dsymutil/X86/Inputs/tail-call.macho.x86_64.o [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/tail-call-linking.test [new file with mode: 0644]