[DWARFLinker][NFC] Change interface of DWARFLinker to specify accel table kinds expli...
authorAlexey Lapshin <a.v.lapshin@mail.ru>
Sun, 20 Nov 2022 19:03:51 +0000 (20:03 +0100)
committerAlexey Lapshin <a.v.lapshin@mail.ru>
Sun, 4 Dec 2022 09:40:56 +0000 (10:40 +0100)
commit82a06a6bd180d7062095131e26a2a04ffa790b2f
tree352f0fcee38fe5d7b7e5b8c5cf93225947b3a886
parentc302fb5cc3118ba05fc4d824f4c358af16732f96
[DWARFLinker][NFC] Change interface of DWARFLinker to specify accel table kinds explicitly.

Currently, DWARFLinker receives kind of accel tables as predefined sets:

```
  Apple,   ///< .apple_names, .apple_namespaces, .apple_types, .apple_objc.
  Dwarf,   ///< DWARF v5 .debug_names.
  Default, ///< Dwarf for DWARF5 or later, Apple otherwise.
  Pub,     ///< .debug_pubnames, .debug_pubtypes
```

This patch removes implicit sets of tables(Default, Dwarf) and allows to ask for several sets:

```
  Apple,     ///< .apple_names, .apple_namespaces, .apple_types, .apple_objc.
  Pub,       ///< .debug_pubnames, .debug_pubtypes
  DebugNames ///< .debug_names.
```

It allows seamlessness adding more accel tables in the future: .gdb_index, .debug_cu_index...
Doing things that way, DWARFLinker will be independent of consumers' requirements.
f.e. dsymutil and llvm-dwarfutil may have different variants for Default set
(so, instead of implementing these differencies inside DWARFLinker it could be
implemented in the corresponding module).

Differential Revision: https://reviews.llvm.org/D132371
llvm/include/llvm/DWARFLinker/DWARFLinker.h
llvm/lib/DWARFLinker/DWARFLinker.cpp
llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
llvm/tools/dsymutil/LinkUtils.h
llvm/tools/dsymutil/dsymutil.cpp
llvm/tools/llvm-dwarfutil/DebugInfoLinker.cpp