diff options
author | Tom Tromey <tom@tromey.com> | 2019-03-07 04:20:19 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-03-07 10:48:02 -0700 |
commit | 25629dfdb438c82f2bb711174042bb326a526aaf (patch) | |
tree | f0bd8f98faa31b5124de5963abe119507a095622 /gdb/objfiles.c | |
parent | fe7266674110f34eacf2e9d2b308f76d33ce50ed (diff) | |
download | gdb-25629dfdb438c82f2bb711174042bb326a526aaf.zip gdb-25629dfdb438c82f2bb711174042bb326a526aaf.tar.gz gdb-25629dfdb438c82f2bb711174042bb326a526aaf.tar.bz2 |
C++-ify bcache
This somewhat C++-ifies bcache. It replaces bcache_xmalloc and
bcache_xfree with constructors; changes some functions into methods;
and changes various structures to include a bcache directly (as
opposed to a pointer to a bcache).
Tested by the buildbot.
gdb/ChangeLog
2019-03-07 Tom Tromey <tom@tromey.com>
* symmisc.c (print_symbol_bcache_statistics): Update.
(print_objfile_statistics): Update.
* symfile.c (allocate_symtab): Update.
* stabsread.c: Don't include bcache.h.
* psymtab.h (struct psymbol_bcache): Don't declare.
(class psymtab_storage) <psymbol_cache>: Now a bcache.
(psymbol_bcache_init, psymbol_bcache_free)
(psymbol_bcache_get_bcache): Don't declare.
* psymtab.c (struct psymbol_bcache): Remove.
(psymtab_storage::psymtab_storage): Update.
(psymtab_storage::~psymtab_storage): Update.
(psymbol_bcache_init, psymbol_bcache_free)
(psymbol_bcache_get_bcache, psymbol_bcache_full): Remove.
(add_psymbol_to_bcache): Update.
(allocate_psymtab): Update.
* objfiles.h (struct objfile_per_bfd_storage) <filename_cache,
macro_cache>: No longer pointers.
* objfiles.c (get_objfile_bfd_data): Don't call bcache_xmalloc.
(free_objfile_per_bfd_storage): Don't call bcache_xfree.
* macrotab.c (macro_bcache): Update.
* macroexp.c: Don't include bcache.h.
* gdbtypes.c (check_types_worklist): Update.
(types_deeply_equal): Remove TRY/CATCH. Update.
* elfread.c (elf_symtab_read): Update.
* dwarf2read.c: Don't include bcache.h.
* buildsym.c (buildsym_compunit::get_macro_table): Update.
* bcache.h (bcache, bcache_full, bcache_xffree, bcache_xmalloc)
(print_bcache_statistics, bcache_memory_used): Don't declare.
(struct bcache): Move from bcache.c. Add constructor, destructor,
methods. Rename all data members.
* bcache.c (struct bcache): Move to bcache.h.
(bcache::expand_hash_table): Rename from expand_hash_table.
(bcache): Remove.
(bcache::insert): Rename from bcache_full.
(bcache::compare): Rename from bcache_compare.
(bcache_xmalloc): Remove.
(bcache::~bcache): Rename from bcache_xfree.
(bcache::print_statistics): Rename from print_bcache_statistics.
(bcache::memory_used): Rename from bcache_memory_used.
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 34b271e..4091b42 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -157,8 +157,6 @@ get_objfile_bfd_data (struct objfile *objfile, struct bfd *abfd) if (abfd != NULL) storage->gdbarch = gdbarch_from_bfd (abfd); - storage->filename_cache = bcache_xmalloc (NULL, NULL); - storage->macro_cache = bcache_xmalloc (NULL, NULL); storage->language_of_main = language_unknown; } @@ -170,8 +168,6 @@ get_objfile_bfd_data (struct objfile *objfile, struct bfd *abfd) static void free_objfile_per_bfd_storage (struct objfile_per_bfd_storage *storage) { - bcache_xfree (storage->filename_cache); - bcache_xfree (storage->macro_cache); if (storage->demangled_names_hash) htab_delete (storage->demangled_names_hash); storage->~objfile_per_bfd_storage (); |