[DWARFv5][DWARFLinker] avoid stripping template names for .debug_names.
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Mon, 26 Jun 2023 21:31:12 +0000 (23:31 +0200)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Wed, 28 Jun 2023 10:05:42 +0000 (12:05 +0200)
commit7424655c2646c5b39127df39694a18f9e76c5567
tree4c4ca5a91fcc93b07df3e9d4190222bde077a63f
parent4f19c6a7c74238875d8568e24b0ae39716aa2091
[DWARFv5][DWARFLinker] avoid stripping template names for .debug_names.

DWARFLinker puts three names for subprograms into the .apple_names and
.debug_names: short name, linkage name, name without template parameters.

DW_TAG_subprogram
   DW_AT_linkage_name "_Z3fooIcEvv"
   DW_AT_name "foo<char>"

short name: "foo<char>"
linkage name: "_Z3fooIcEvv"
name without template parameters: "foo"

DWARFv5 does not require stripping template parameters for subprogram name.
Current llvm-dwarfdump --verify reports the error if names stored in
accelerator table do not match with DIE name(name with stripped template
parameters stored in accelerator table does not match with original DIE name).
This patch does not store name without template parameters into the .debug_names table.

Differential Revision: https://reviews.llvm.org/D153869
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/test/tools/dsymutil/X86/Inputs/dwarf5-accel.o [new file with mode: 0644]
llvm/test/tools/dsymutil/X86/dwarf5-accel.test [new file with mode: 0644]