Allocate dwz_file with new
This adds a constructor to struct dwz_file and arranges for it to be
allocated with "new" and wrapped in a unique_ptr. This cuts down on
the amount of manual memory management that must be done.
Regression tested by the buildbot.
gdb/ChangeLog
2018-05-18 Tom Tromey <tom@tromey.com>
* dwarf2read.c (struct dwz_file): Add constructor, initializers.
<dwz_bfd>: Now a gdb_bfd_ref_ptr.
(~dwarf2_per_objfile): Update
(dwarf2_get_dwz_file): Use new.
* dwarf2read.h (struct dwarf2_per_objfile) <dwz_file>: Now a
unique_ptr.