Use std::vector for field lists in dwarf2read.c
authorTom Tromey <tom@tromey.com>
Sun, 11 Mar 2018 03:47:06 +0000 (20:47 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 12 Mar 2018 03:06:41 +0000 (21:06 -0600)
commitbe2daae6b8df45f3f6de5d94a1938cef54336a72
treee7ac98e2b8e56b8a943fb78bcbdf90903ffc44bc
parent484cf504af0e9403e3437a5d2c5fb361c73daa90
Use std::vector for field lists in dwarf2read.c

This changes dwarf2read.c to use std::vector rather than a linked list
when managing the fields and base classes to be added to a type.  This
removes some bookkeeping types and also allows the removal of some
cleanups.

gdb/ChangeLog
2018-03-11  Tom Tromey  <tom@tromey.com>

* dwarf2read.c (struct nextfield): Add initializers.
(struct nextfnfield): Remove.
(struct fnfieldlist): Add initializers.  Remove "length" and
"head", use std::vector.
(struct decl_field_list): Remove.
(struct field_info): Add initializers.
<fields, baseclasses>: Now std::vector.
<nbaseclasses, nfnfields, typedef_field_list_count,
nested_types_list_count>: Remove.
(dwarf2_add_field, dwarf2_add_type_defn)
(dwarf2_attach_fields_to_type, dwarf2_add_member_fn)
(dwarf2_attach_fn_fields_to_type, handle_struct_member_die)
(process_structure_scope): Update.
gdb/ChangeLog
gdb/dwarf2read.c