Simplify per-BFD storage management
authorTom Tromey <tom@tromey.com>
Sat, 2 Mar 2019 19:11:26 +0000 (12:11 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 15 Mar 2019 22:02:09 +0000 (16:02 -0600)
commitd6797f465c3f67b41a0db38870bbd33384b6551f
tree170543bd51da158cd4fd08805038d8973e9e6b1c
parent741d7538b7540fea1086fe6ab962227d2cf7418e
Simplify per-BFD storage management

There's no reason that the objfile_per_bfd_storage must be allocated
via bfd_alloc.  This patch changes objfile_per_bfd_storage to be
managed more simply, via ordinary new and delete; and moves some code
into its (new) destructor.

While doing this I also noticed an extra initialization of
language_of_main, and removed it.

gdb/ChangeLog
2019-03-15  Tom Tromey  <tom@tromey.com>

* objfiles.h (struct objfile_per_bfd_storage): Declare
destructor.
* objfiles.c (objfile_per_bfd_storage::~objfile_per_bfd_storage):
New.
(get_objfile_bfd_data): Use new.  Don't initialize
language_of_main.
(free_objfile_per_bfd_storage): Remove.
(objfile_bfd_data_free, objfile::~objfile): Use delete.
gdb/ChangeLog
gdb/objfiles.c
gdb/objfiles.h
This page took 0.026192 seconds and 4 git commands to generate.