Micro-optimize abbrev reading and storage
Currently, and abbrev_info points to a separately allocated array of
attr_abbrev objects. This array is constructed in a temporary vector,
then copied to the abbrev table's obstack.
This patch changes abbrev_info to use the struct hack to store the
objects directly, and changes abbrev_table::read to avoid an extra
copy when allocating, using the "growing objects" capability of
obstacks.
This saves a bit of space, and also perhaps a little time.
2021-03-06 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (read_attribute): Make 'abbrev' const.
* dwarf2/abbrev.c (abbrev_table::alloc_abbrev): Remove.
(abbrev_table::read): Update.
* dwarf2/abbrev.h (struct attr_abbrev): Move earlier.
(struct abbrev_info): Reformat.
<attrs>: Now an array.
(struct abbrev_table) <alloc_abbrev>: Remove.