aboutsummaryrefslogtreecommitdiff
path: root/gdb/d-namespace.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2024-10-23 10:50:32 -0600
committerTom Tromey <tromey@adacore.com>2024-11-11 07:51:05 -0700
commitb6829c3c917a3557beee70fcdd86990661404ea5 (patch)
tree4176e6319077dea150f148ff4584ed88de0e1fbe /gdb/d-namespace.c
parentfba3b6d16c206882c3ccb98da38271cf36100629 (diff)
downloadgdb-b6829c3c917a3557beee70fcdd86990661404ea5.zip
gdb-b6829c3c917a3557beee70fcdd86990661404ea5.tar.gz
gdb-b6829c3c917a3557beee70fcdd86990661404ea5.tar.bz2
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.
Diffstat (limited to 'gdb/d-namespace.c')
-rw-r--r--gdb/d-namespace.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gdb/d-namespace.c b/gdb/d-namespace.c
index 0bcd75d..530349e 100644
--- a/gdb/d-namespace.c
+++ b/gdb/d-namespace.c
@@ -362,7 +362,6 @@ d_lookup_symbol_imports (const char *scope, const char *name,
const struct block *block,
const domain_search_flags domain)
{
- struct using_direct *current;
struct block_symbol sym;
/* First, try to find the symbol in the given module. */
@@ -375,9 +374,7 @@ d_lookup_symbol_imports (const char *scope, const char *name,
the module we're searching in, see if we can find a match by
applying them. */
- for (current = block->get_using ();
- current != NULL;
- current = current->next)
+ for (using_direct *current : block->get_using ())
{
const char **excludep;