This changes end_psymtab_common to be a method on partial_symtab.
This seems a little cleaner to me.
gdb/ChangeLog
2020-11-01 Tom Tromey <tom@tromey.com>
* dbxread.c (dbx_end_psymtab): Update.
* dwarf2/read.c (process_psymtab_comp_unit_reader)
(build_type_psymtabs_reader): Update.
* xcoffread.c (xcoff_end_psymtab): Update.
* ctfread.c (scan_partial_symbols): Update.
* psymtab.c (sort_pst_symbols): Remove.
(partial_symtab::end): Rename from end_psymtab_common. Inline
sort_pst_symbols.
* psympriv.h (struct partial_symtab) <end>: New method.
(end_psymtab_common): Don't declare.
+2020-11-01 Tom Tromey <tom@tromey.com>
+
+ * dbxread.c (dbx_end_psymtab): Update.
+ * dwarf2/read.c (process_psymtab_comp_unit_reader)
+ (build_type_psymtabs_reader): Update.
+ * xcoffread.c (xcoff_end_psymtab): Update.
+ * ctfread.c (scan_partial_symbols): Update.
+ * psymtab.c (sort_pst_symbols): Remove.
+ (partial_symtab::end): Rename from end_psymtab_common. Inline
+ sort_pst_symbols.
+ * psympriv.h (struct partial_symtab) <end>: New method.
+ (end_psymtab_common): Don't declare.
+
2020-11-01 Tom Tromey <tom@tromey.com>
* symmisc.c (count_psyms): New function.
0, language_c, of);
}
- end_psymtab_common (pst);
+ pst->end ();
}
/* Read CTF debugging information from a BFD section. This is
/* End of kludge for patching Solaris textlow and texthigh. */
- end_psymtab_common (pst);
+ pst->end ();
pst->number_of_dependencies = number_dependencies;
if (number_dependencies)
best_highpc + baseaddr)
- baseaddr);
- end_psymtab_common (pst);
+ pst->end ();
if (!cu->per_cu->imported_symtabs_empty ())
{
highpc = (CORE_ADDR) 0;
scan_partial_symbols (first_die, &lowpc, &highpc, 0, cu);
- end_psymtab_common (pst);
+ pst->end ();
}
/* Struct used to sort TUs by their abbreviation table offset. */
struct objfile *objfile);
+ /* Indicate that this partial symtab is complete. */
+
+ void end ();
+
/* Chain of all existing partial symtabs. */
struct partial_symtab *next = nullptr;
void *read_symtab_private = nullptr;
};
-extern void end_psymtab_common (struct partial_symtab *);
-
/* Used when recording partial symbol tables. On destruction,
discards any partial symbol tables that have been built. However,
the tables can be kept by calling the "keep" method. */
\f
-static void
-sort_pst_symbols (struct partial_symtab *pst)
-{
- /* Sort the global list; don't sort the static list. */
- std::sort (pst->global_psymbols.begin (),
- pst->global_psymbols.end (),
- [] (partial_symbol *s1, partial_symbol *s2)
- {
- return strcmp_iw_ordered (s1->ginfo.search_name (),
- s2->ginfo.search_name ()) < 0;
- });
-}
-
/* Partially fill a partial symtab. It will be completely filled at
the end of the symbol list. */
/* Perform "finishing up" operations of a partial symtab. */
void
-end_psymtab_common (struct partial_symtab *pst)
+partial_symtab::end ()
{
- pst->global_psymbols.shrink_to_fit ();
- pst->static_psymbols.shrink_to_fit ();
+ global_psymbols.shrink_to_fit ();
+ static_psymbols.shrink_to_fit ();
- sort_pst_symbols (pst);
+ /* Sort the global list; don't sort the static list. */
+ std::sort (global_psymbols.begin (),
+ global_psymbols.end (),
+ [] (partial_symbol *s1, partial_symbol *s2)
+ {
+ return strcmp_iw_ordered (s1->ginfo.search_name (),
+ s2->ginfo.search_name ()) < 0;
+ });
}
/* See psymtab.h. */
first_fun_line_offset;
first_fun_line_offset = 0;
- end_psymtab_common (pst);
+ pst->end ();
pst->number_of_dependencies = number_dependencies;
if (number_dependencies)