Minor cleanups in abbrev_table

This cleans up the DWARF abbrev_table API a bit, primarily by making
various methods and members private.

2020-02-08  Tom Tromey  <tom@tromey.com>

	* dwarf2/read.c (read_cutu_die_from_dwo): Update.
	(cutu_reader): Update.
	(build_type_psymtabs_1): Update.
	* dwarf2/abbrev.c (abbrev_table::read): Rename.
	(abbrev_table::alloc_abbrev): Update.
	* dwarf2/abbrev.h (abbrev_table_up): Move earlier.
	(abbrev_table::read): New static method, renamed from
	abbrev_table_read_table.
	(abbrev_table::alloc_abbrev)
	(abbrev_table::add_abbrev): Now private.
	(abbrev_table::abbrev_table): Now private.
	(abbrev_table::m_abbrev_obstack): Now private.  Rename.

Change-Id: I320dca83b799f672909ae66f73b7aca266adbaf9
This commit is contained in:
Tom Tromey
2020-02-08 13:40:54 -07:00
parent 0335378b4c
commit 86de1d91ac
4 changed files with 52 additions and 37 deletions

View File

@ -44,7 +44,7 @@ abbrev_table::alloc_abbrev ()
{
struct abbrev_info *abbrev;
abbrev = XOBNEW (&abbrev_obstack, struct abbrev_info);
abbrev = XOBNEW (&m_abbrev_obstack, struct abbrev_info);
memset (abbrev, 0, sizeof (struct abbrev_info));
return abbrev;
@ -87,9 +87,9 @@ abbrev_table::lookup_abbrev (unsigned int abbrev_number)
/* Read in an abbrev table. */
abbrev_table_up
abbrev_table_read_table (struct objfile *objfile,
struct dwarf2_section_info *section,
sect_offset sect_off)
abbrev_table::read (struct objfile *objfile,
struct dwarf2_section_info *section,
sect_offset sect_off)
{
bfd *abfd = section->get_bfd_owner ();
const gdb_byte *abbrev_ptr;
@ -152,7 +152,7 @@ abbrev_table_read_table (struct objfile *objfile,
}
cur_abbrev->attrs =
XOBNEWVEC (&abbrev_table->abbrev_obstack, struct attr_abbrev,
XOBNEWVEC (&abbrev_table->m_abbrev_obstack, struct attr_abbrev,
cur_abbrev->num_attrs);
memcpy (cur_abbrev->attrs, cur_attrs.data (),
cur_abbrev->num_attrs * sizeof (struct attr_abbrev));