Allocate dwp_file with new
authorTom Tromey <tom@tromey.com>
Thu, 17 May 2018 06:04:53 +0000 (00:04 -0600)
committerTom Tromey <tom@tromey.com>
Fri, 18 May 2018 20:33:24 +0000 (14:33 -0600)
commit400174b12a46fffbfad7c2504c33bb3ac29f3ef9
treec2d7292909fcce4148ef069f760fdbc42081a89e
parent3063847f29cb83bae0cdf018c2dca68b65a50780
Allocate dwp_file with new

This adds a constructor and initializer to dwp_file and changes it to
be allocated with "new".  This removes a bit of manual refcount
management.

Tested by the buildbot.

gdb/ChangeLog
2018-05-18  Tom Tromey  <tom@tromey.com>

* dwarf2read.h (struct dwarf2_per_objfile) <dwp_file>: Now a
unique_ptr.
* dwarf2read.c (struct dwp_file): Add constructor and
initializers.
(open_and_init_dwp_file): Return a unique_ptr.
(dwarf2_per_objfile, create_dwp_hash_table)
(create_dwo_unit_in_dwp_v1, create_dwo_unit_in_dwp_v2)
(lookup_dwo_unit_in_dwp): Update.
(open_and_init_dwp_file, get_dwp_file): Update.
gdb/ChangeLog
gdb/dwarf2read.c
gdb/dwarf2read.h