aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/read.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-04-30 14:07:58 -0600
committerTom Tromey <tom@tromey.com>2021-04-30 14:07:58 -0600
commit91eea9cc48a17763dae5a4f10eaa111c512ee2d0 (patch)
tree22e069d7bba326a0e9500e7d4ebcaaf8ae850382 /gdb/dwarf2/read.h
parent0d305d5c67e38a65f227e6604c0812797471ace6 (diff)
downloadbinutils-91eea9cc48a17763dae5a4f10eaa111c512ee2d0.zip
binutils-91eea9cc48a17763dae5a4f10eaa111c512ee2d0.tar.gz
binutils-91eea9cc48a17763dae5a4f10eaa111c512ee2d0.tar.bz2
Remove dwarf2_per_bfd::all_type_units
I don't think there is any deep reason to separate CUs and TUs in dwarf2_per_bfd. This patch removes all_type_units and unifies these two containers. Some minor tweaks are needed to the index writers, because both forms of index keep CUs and TUs separate; Regression tested on x86-63 Fedora 32. gdb/ChangeLog 2021-04-30 Tom Tromey <tom@tromey.com> * dwarf2/read.h (struct tu_stats) <nr_tus>: New member. (struct dwarf2_per_bfd) <get_cutu, get_tu>: Remove <get_cu>: Now inline. <all_type_units>: Remove. * dwarf2/read.c (dwarf2_per_bfd::~dwarf2_per_bfd): Update. (dwarf2_per_bfd::get_cutu, dwarf2_per_bfd::get_cu) (dwarf2_per_bfd::get_tu): Remove. (dwarf2_per_bfd::allocate_signatured_type): Update nr_tus. (create_signatured_type_table_from_index) (create_signatured_type_table_from_debug_names) (dw2_symtab_iter_next, dwarf2_base_index_functions::print_stats) (dwarf2_base_index_functions::expand_all_symtabs) (dw2_expand_marked_cus, dw_expand_symtabs_matching_file_matcher) (dwarf2_base_index_functions::map_symbol_filenames) (dw2_debug_names_iterator::next, dwarf2_initialize_objfile) (add_signatured_type_cu_to_table, create_all_type_units) (add_type_unit, build_type_psymtabs_1, print_tu_stats) (create_all_comp_units): Update. * dwarf2/index-write.c (check_dwarf64_offsets, write_gdbindex) (write_debug_names): Update.
Diffstat (limited to 'gdb/dwarf2/read.h')
-rw-r--r--gdb/dwarf2/read.h32
1 files changed, 6 insertions, 26 deletions
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 98ace89..80f0e3e 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -42,6 +42,7 @@ struct tu_stats
int nr_symtab_sharers;
int nr_stmt_less_type_units;
int nr_all_type_units_reallocs;
+ int nr_tus;
};
struct dwarf2_cu;
@@ -93,29 +94,11 @@ struct dwarf2_per_bfd
DISABLE_COPY_AND_ASSIGN (dwarf2_per_bfd);
- /* Return the CU/TU given its index.
-
- This is intended for loops like:
-
- for (i = 0; i < (dwarf2_per_bfd->n_comp_units
- + dwarf2_per_bfd->n_type_units); ++i)
- {
- dwarf2_per_cu_data *per_cu = dwarf2_per_bfd->get_cutu (i);
-
- ...;
- }
- */
- dwarf2_per_cu_data *get_cutu (int index);
-
- /* Return the CU given its index.
- This differs from get_cutu in that it's for when you know INDEX refers to a
- CU. */
- dwarf2_per_cu_data *get_cu (int index);
-
- /* Return the TU given its index.
- This differs from get_cutu in that it's for when you know INDEX refers to a
- TU. */
- signatured_type *get_tu (int index);
+ /* Return the CU given its index. */
+ dwarf2_per_cu_data *get_cu (int index) const
+ {
+ return this->all_comp_units[index].get ();
+ }
/* A convenience function to allocate a dwarf2_per_cu_data. The
returned object has its "index" field set properly. The object
@@ -173,9 +156,6 @@ public:
the target compilation unit of a particular reference. */
std::vector<std::unique_ptr<dwarf2_per_cu_data>> all_comp_units;
- /* The .debug_types-related CUs (TUs). */
- std::vector<std::unique_ptr<signatured_type>> all_type_units;
-
/* Table of struct type_unit_group objects.
The hash key is the DW_AT_stmt_list value. */
htab_up type_unit_groups;