const lookup_name_info &lookup_name,
domain_search_flags domain)
{
- struct using_direct *renaming;
int defns_mark = result.size ();
symbol_name_matcher_ftype *name_match
= ada_get_symbol_name_matcher (lookup_name);
- for (renaming = block->get_using ();
- renaming != NULL;
- renaming = renaming->next)
+ for (using_direct *renaming : block->get_using ())
{
const char *r_name;
/* See block.h. */
-struct using_direct *
+next_range<using_direct>
block::get_using () const
{
if (m_namespace_info == nullptr)
- return nullptr;
+ return {};
else
- return m_namespace_info->using_decl;
+ return next_range<using_direct> (m_namespace_info->using_decl);
}
/* See block.h. */
#include "dictionary.h"
#include "gdbsupport/array-view.h"
+#include "gdbsupport/next-iterator.h"
/* Opaque declarations. */
/* This returns the using directives list associated with this
block, if any. */
- struct using_direct *get_using () const;
+ next_range<using_direct> get_using () const;
/* Set this block's using member to USING; if needed, allocate
memory via OBSTACK. (It won't make a copy of USING, however, so
std::map<std::string,
struct block_symbol>& found_symbols)
{
- struct using_direct *current;
struct block_symbol sym = {};
int len;
int directive_match;
/* Go through the using directives. If any of them add new names to
the namespace 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;
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,
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)
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. */
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;