forked from Imagelibrary/binutils-gdb
Remove partial symbol statistics
The "n_psyms" statistic in the per-objfile stats is not really needed, but its use requires passing the objfile to add_psymbol. This patch removes the field in favor of counting the psyms when needed. Note that this is not exactly equivalent -- in the old approach, a psymbol can in theory be created and then the psymtab discarded, which would increment the counter. This does not seem very important to me. I rewrote the code to count partial symbols; though TBH I think that this information is not really very useful. gdb/ChangeLog 2020-11-01 Tom Tromey <tom@tromey.com> * symmisc.c (count_psyms): New function. (print_objfile_statistics): Use it. * psymtab.c (append_psymbol_to_list): Remove. (partial_symtab::add_psymbol): Inline append_psymbol_to_list. * objfiles.h (struct objstats) <n_psyms>: Remove.
This commit is contained in:
@@ -1523,17 +1523,6 @@ add_psymbol_to_bcache (const partial_symbol &psymbol, struct objfile *objfile,
|
||||
(&psymbol, sizeof (struct partial_symbol), added));
|
||||
}
|
||||
|
||||
/* Helper function, adds partial symbol to the given partial symbol list. */
|
||||
|
||||
static void
|
||||
append_psymbol_to_list (std::vector<partial_symbol *> &list,
|
||||
struct partial_symbol *psym,
|
||||
struct objfile *objfile)
|
||||
{
|
||||
list.push_back (psym);
|
||||
OBJSTAT (objfile, n_psyms++);
|
||||
}
|
||||
|
||||
/* See psympriv.h. */
|
||||
|
||||
void
|
||||
@@ -1555,7 +1544,7 @@ partial_symtab::add_psymbol (const partial_symbol &psymbol,
|
||||
= (where == psymbol_placement::STATIC
|
||||
? static_psymbols
|
||||
: global_psymbols);
|
||||
append_psymbol_to_list (list, psym, objfile);
|
||||
list.push_back (psym);
|
||||
}
|
||||
|
||||
/* See psympriv.h. */
|
||||
|
||||
Reference in New Issue
Block a user