aboutsummaryrefslogtreecommitdiff
path: root/gdb/buildsym.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-04-16 09:10:02 -0600
committerTom Tromey <tom@tromey.com>2023-05-07 12:44:17 -0600
commit8e8d48f91c26cb4aabbdc56d96608e5d2310b986 (patch)
treeebce18957e2404e7dcd07c5784457107f021218c /gdb/buildsym.c
parent5250cbc85cbbf13221ed508c1b89f1ee0a6ac1ec (diff)
downloadbinutils-8e8d48f91c26cb4aabbdc56d96608e5d2310b986.zip
binutils-8e8d48f91c26cb4aabbdc56d96608e5d2310b986.tar.gz
binutils-8e8d48f91c26cb4aabbdc56d96608e5d2310b986.tar.bz2
Remove ALL_DICT_SYMBOLS
This replaces ALL_DICT_SYMBOLS with an iterator so that for-each can be used.
Diffstat (limited to 'gdb/buildsym.c')
-rw-r--r--gdb/buildsym.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index f000233..d12ad21 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -244,7 +244,6 @@ buildsym_compunit::finish_block_internal
if (symbol)
{
struct type *ftype = symbol->type ();
- struct mdict_iterator miter;
symbol->set_value_block (block);
symbol->set_section_index (SECT_OFF_TEXT (m_objfile));
block->set_function (symbol);
@@ -255,11 +254,10 @@ buildsym_compunit::finish_block_internal
function's type. Set that from the type of the
parameter symbols. */
int nparams = 0, iparams;
- struct symbol *sym;
/* Here we want to directly access the dictionary, because
we haven't fully initialized the block yet. */
- ALL_DICT_SYMBOLS (block->multidict (), miter, sym)
+ for (struct symbol *sym : block->multidict_symbols ())
{
if (sym->is_argument ())
nparams++;
@@ -274,7 +272,7 @@ buildsym_compunit::finish_block_internal
iparams = 0;
/* Here we want to directly access the dictionary, because
we haven't fully initialized the block yet. */
- ALL_DICT_SYMBOLS (block->multidict (), miter, sym)
+ for (struct symbol *sym : block->multidict_symbols ())
{
if (iparams == nparams)
break;
@@ -975,8 +973,6 @@ buildsym_compunit::end_compunit_symtab_with_blockvector
for (block_i = 0; block_i < blockvector->num_blocks (); block_i++)
{
struct block *block = blockvector->block (block_i);
- struct symbol *sym;
- struct mdict_iterator miter;
/* Inlined functions may have symbols not in the global or
static symbol lists. */
@@ -985,9 +981,10 @@ buildsym_compunit::end_compunit_symtab_with_blockvector
block->function ()->set_symtab (symtab);
/* Note that we only want to fix up symbols from the local
- blocks, not blocks coming from included symtabs. That is why
- we use ALL_DICT_SYMBOLS here and not a block iterator. */
- ALL_DICT_SYMBOLS (block->multidict (), miter, sym)
+ blocks, not blocks coming from included symtabs. That is
+ why we use an mdict iterator here and not a block
+ iterator. */
+ for (struct symbol *sym : block->multidict_symbols ())
if (sym->symtab () == NULL)
sym->set_symtab (symtab);
}