Allocate dwarf2_cu with new
authorSimon Marchi <simon.marchi@ericsson.com>
Sun, 7 Jan 2018 16:41:09 +0000 (11:41 -0500)
committerTom Tromey <tom@tromey.com>
Wed, 17 Jan 2018 18:28:44 +0000 (11:28 -0700)
commitfcd3b13d80a2d0e5fc31ef6a245be62db6a11420
tree1f25674ad152bb9a4b2f9897ac1a50fbf5d97d5d
parent685af9cd2283b07a222157723e239f09d6ea2682
Allocate dwarf2_cu with new

This changes dwarf2_cu to be allocated with new, and fixes up the
users.

2018-01-17  Tom Tromey  <tom@tromey.com>
    Simon Marchi  <simon.marchi@ericsson.com>

* dwarf2read.c (struct dwarf2_cu): Add constructor, destructor.
(dwarf2_per_objfile::free_cached_comp_units)
(init_tu_and_read_dwo_dies, init_cutu_and_read_dies)
(init_cutu_and_read_dies_no_follow): Update.
(dwarf2_cu::dwarf2_cu): Rename from init_one_comp_unit.
(dwarf2_cu::~dwarf2_cu): New.
(free_heap_comp_unit, free_stack_comp_unit): Remove.
(age_cached_comp_units, free_one_cached_comp_unit): Update.
gdb/ChangeLog
gdb/dwarf2read.c