[BOLT][DWARF] Fix TU Index handling for DWARF4/5
authorAlexander Yermolovich <ayermolo@fb.com>
Thu, 2 Jun 2022 01:15:41 +0000 (18:15 -0700)
committerAlexander Yermolovich <ayermolo@fb.com>
Thu, 2 Jun 2022 01:16:12 +0000 (18:16 -0700)
commitab9a17599021a4459e23e3a1d7aa57e9413baab5
tree9b8a7a6b2f5ed48e622ad6597613213ce09186ed
parent4cb722acbccd161bdcde49102bc9645587b808ae
[BOLT][DWARF] Fix TU Index handling for DWARF4/5

When we generate split dwarf with -fdebug-types-section we will have
.debug_types.dwo sections. These go into TU Index when we run llvm-dwp. BOLT was
not handling DWP input correctly with this section.

Added support for handling DWP with TU Index as an input and output for DWARF4.
Added support for handling DWP with TU Index as an input for DWARF5

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D126087
bolt/include/bolt/Rewrite/DWARFRewriter.h
bolt/lib/Rewrite/DWARFRewriter.cpp
bolt/test/CMakeLists.txt
bolt/test/X86/Inputs/dwarf4-ftypes-split-dwarf.s [new file with mode: 0644]
bolt/test/X86/Inputs/dwarf5-ftypes-split-dwarf.s [new file with mode: 0644]
bolt/test/X86/dwarf4-ftypes-dwo-input-dwp-output.test [new file with mode: 0644]
bolt/test/X86/dwarf4-ftypes-dwp-input-dwo-output.test [new file with mode: 0644]
bolt/test/X86/dwarf4-ftypes-dwp-input-dwp-output.test [new file with mode: 0644]
bolt/test/X86/dwarf5-ftypes-dwp-input-dwo-output.test [new file with mode: 0644]
bolt/test/lit.cfg.py