diff options
author | Tom Tromey <tom@tromey.com> | 2018-07-11 22:55:17 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-07-20 09:42:49 -0600 |
commit | 6b213a4778fae60d40257aee37c3fdec837ea574 (patch) | |
tree | 43921eef431ad0d6078f3d27e9bc42a450fee05d /gdb/buildsym.c | |
parent | b80a981d0867f554d382eef9fc16081b12ac0543 (diff) | |
download | gdb-6b213a4778fae60d40257aee37c3fdec837ea574.zip gdb-6b213a4778fae60d40257aee37c3fdec837ea574.tar.gz gdb-6b213a4778fae60d40257aee37c3fdec837ea574.tar.bz2 |
Remove parameter from record_pending_block
This removes a redundant parameter from record_pending_block. It also
moves record_pending_block earlier in the file, so that a forward
declaration is no longer needed.
gdb/ChangeLog
2018-07-20 Tom Tromey <tom@tromey.com>
* buildsym.c (record_pending_block): Move earlier. Remove objfile
parameter.
(finish_block_internal): Update.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r-- | gdb/buildsym.c | 59 |
1 files changed, 25 insertions, 34 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c index dffd077..5cad1fd 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -282,10 +282,6 @@ static void free_buildsym_compunit (void); static int compare_line_numbers (const void *ln1p, const void *ln2p); -static void record_pending_block (struct objfile *objfile, - struct block *block, - struct pending_block *opblock); - /* Initial sizes of data structures. These are realloc'd larger if needed, and realloc'd down to the size actually used, when completed. */ @@ -355,6 +351,30 @@ scoped_free_pendings::~scoped_free_pendings () free_buildsym_compunit (); } +/* Record BLOCK on the list of all blocks in the file. Put it after + OPBLOCK, or at the beginning if opblock is NULL. This puts the + block in the list after all its subblocks. */ + +static void +record_pending_block (struct block *block, struct pending_block *opblock) +{ + struct pending_block *pblock; + + pblock = XOBNEW (&buildsym_compunit->m_pending_block_obstack, + struct pending_block); + pblock->block = block; + if (opblock) + { + pblock->next = opblock->next; + opblock->next = pblock; + } + else + { + pblock->next = buildsym_compunit->m_pending_blocks; + buildsym_compunit->m_pending_blocks = pblock; + } +} + /* Take one of the lists of symbols and make a block from it. Keep the order the symbols have in the list (reversed from the input file). Put the block on the list of pending blocks. */ @@ -545,7 +565,7 @@ finish_block_internal (struct symbol *symbol, else buildsym_compunit->m_local_using_directives = NULL; - record_pending_block (objfile, block, opblock); + record_pending_block (block, opblock); return block; } @@ -561,35 +581,6 @@ finish_block (struct symbol *symbol, start, end, 0, 0); } -/* Record BLOCK on the list of all blocks in the file. Put it after - OPBLOCK, or at the beginning if opblock is NULL. This puts the - block in the list after all its subblocks. - - Allocate the pending block struct in the objfile_obstack to save - time. This wastes a little space. FIXME: Is it worth it? */ - -static void -record_pending_block (struct objfile *objfile, struct block *block, - struct pending_block *opblock) -{ - struct pending_block *pblock; - - pblock = XOBNEW (&buildsym_compunit->m_pending_block_obstack, - struct pending_block); - pblock->block = block; - if (opblock) - { - pblock->next = opblock->next; - opblock->next = pblock; - } - else - { - pblock->next = buildsym_compunit->m_pending_blocks; - buildsym_compunit->m_pending_blocks = pblock; - } -} - - /* Record that the range of addresses from START to END_INCLUSIVE (inclusive, like it says) belongs to BLOCK. BLOCK's start and end addresses must be set already. You must apply this function to all |