aboutsummaryrefslogtreecommitdiff
path: root/gdb/psymtab.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-07 04:20:19 -0700
committerTom Tromey <tom@tromey.com>2019-03-07 10:48:02 -0700
commit25629dfdb438c82f2bb711174042bb326a526aaf (patch)
treef0bd8f98faa31b5124de5963abe119507a095622 /gdb/psymtab.h
parentfe7266674110f34eacf2e9d2b308f76d33ce50ed (diff)
downloadgdb-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/psymtab.h')
-rw-r--r--gdb/psymtab.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/gdb/psymtab.h b/gdb/psymtab.h
index 3ee5eee..c761fa7 100644
--- a/gdb/psymtab.h
+++ b/gdb/psymtab.h
@@ -23,13 +23,10 @@
#include "gdb_obstack.h"
#include "symfile.h"
#include "common/next-iterator.h"
+#include "bcache.h"
struct partial_symbol;
-/* A bcache for partial symbols. */
-
-struct psymbol_bcache;
-
/* An instance of this class manages the partial symbol tables and
partial symbols for a given objfile.
@@ -119,7 +116,7 @@ public:
/* A byte cache where we can stash arbitrary "chunks" of bytes that
will not change. */
- struct psymbol_bcache *psymbol_cache;
+ struct bcache psymbol_cache;
/* Vectors of all partial symbols read in from file. The actual data
is stored in the objfile_obstack. */
@@ -140,10 +137,6 @@ private:
};
-extern struct psymbol_bcache *psymbol_bcache_init (void);
-extern void psymbol_bcache_free (struct psymbol_bcache *);
-extern struct bcache *psymbol_bcache_get_bcache (struct psymbol_bcache *);
-
extern const struct quick_symbol_functions psym_functions;
extern const struct quick_symbol_functions dwarf2_gdb_index_functions;