aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-20 22:45:44 -0600
committerTom Tromey <tom@tromey.com>2018-07-16 08:55:21 -0600
commit652788a73137d8c16ac67a0cf9a8e51dd336d09e (patch)
tree4f569a0ee787371750a169035ddee26d169f8c8b /gdb/buildsym.c
parent8419ee5331d5b3253d2bfe1a039f12a167292dfc (diff)
downloadgdb-652788a73137d8c16ac67a0cf9a8e51dd336d09e.zip
gdb-652788a73137d8c16ac67a0cf9a8e51dd336d09e.tar.gz
gdb-652788a73137d8c16ac67a0cf9a8e51dd336d09e.tar.bz2
Make free_pending_blocks static
free_pending_blocks can be static because scoped_free_pendings (et al) arrange for it to be NULL in the "steady state". This removes a couple of unnecessary calls to free_pending_blocks and changes it to be static. gdb/ChangeLog 2018-07-16 Tom Tromey <tom@tromey.com> * xcoffread.c (xcoff_initial_scan): Don't call free_pending_blocks. * dbxread.c (dbx_symfile_read): Don't call free_pending_blocks. * buildsym.h (class scoped_free_pendings): Add constructor. (free_pending_blocks): Don't declare. * buildsym.c (scoped_free_pendings::scoped_free_pendings): New. (free_pending_blocks): Now static.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index 8d06cec..4e5da07 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -263,6 +263,8 @@ static void record_pending_block (struct objfile *objfile,
struct block *block,
struct pending_block *opblock);
+static void free_pending_blocks ();
+
/* Initial sizes of data structures. These are realloc'd larger if
needed, and realloc'd down to the size actually used, when
completed. */
@@ -331,6 +333,11 @@ find_symbol_in_list (struct pending *list, char *name, int length)
return (NULL);
}
+scoped_free_pendings::scoped_free_pendings ()
+{
+ gdb_assert (pending_blocks == nullptr);
+}
+
/* At end of reading syms, or in case of quit, ensure everything
associated with building symtabs is freed.
@@ -373,8 +380,8 @@ scoped_free_pendings::~scoped_free_pendings ()
/* This function is called to discard any pending blocks. */
-void
-free_pending_blocks (void)
+static void
+free_pending_blocks ()
{
if (pending_blocks != NULL)
{