Unify the DWARF index holders

The dwarf2_per_bfd object has a separate field for each possible kind
of index.  Until an earlier patch in this series, two of these were
even derived from a common base class, but still had separate slots.
This patch unifies all the index fields using the common base class
that was introduced earlier in this series.  This makes it more
obvious that only a single index can be active at a time, and also
removes some code from dwarf2_initialize_objfile.
This commit is contained in:
Tom Tromey
2021-11-22 17:05:55 -07:00
parent f75a1d3a73
commit a827b8ec32
3 changed files with 72 additions and 73 deletions

View File

@@ -441,14 +441,8 @@ public:
VMA of 0. */
bool has_section_at_zero = false;
/* The mapped index, or NULL if .gdb_index is missing or not being used. */
std::unique_ptr<mapped_index> index_table;
/* The mapped index, or NULL if .debug_names is missing or not being used. */
std::unique_ptr<mapped_debug_names> debug_names_table;
/* The cooked index, or NULL if not using one. */
std::unique_ptr<cooked_index_vector> cooked_index_table;
/* The mapped index, or NULL in the readnow case. */
std::unique_ptr<dwarf_scanner_base> index_table;
/* When using index_table, this keeps track of all quick_file_names entries.
TUs typically share line table entries with a CU, so we maintain a