Use an iterator range for 'using' directives

This patch changes block::get_using to return an iterator range.  This
seemed cleaner to me than the current approach of returning a pointer
to the first using directive; all the callers actually use this to
iterate.
This commit is contained in:
Tom Tromey
2024-10-23 10:50:32 -06:00
parent fba3b6d16c
commit b6829c3c91
6 changed files with 9 additions and 20 deletions

View File

@@ -1390,7 +1390,6 @@ add_symbol_overload_list_using (const char *func_name,
const char *the_namespace,
std::vector<symbol *> *overload_list)
{
struct using_direct *current;
const struct block *block;
/* First, go through the using directives. If any of them apply,
@@ -1400,9 +1399,7 @@ add_symbol_overload_list_using (const char *func_name,
for (block = get_selected_block (0);
block != NULL;
block = block->superblock ())
for (current = block->get_using ();
current != NULL;
current = current->next)
for (using_direct *current : block->get_using ())
{
/* Prevent recursive calls. */
if (current->searched)