summaryrefslogtreecommitdiff
path: root/gdb/cp-support.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2022-02-06 22:54:03 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-04-27 22:05:03 -0400
commit63d609debba854d08a515f73d0ad8e4ef8948370 (patch)
treec5e6b2c9d4b48350c707316a48e69388524cdf66 /gdb/cp-support.c
parent6395b62847e581acc3e8fa179444b824d17b3d68 (diff)
downloadbinutils-gdb-63d609debba854d08a515f73d0ad8e4ef8948370.tar.gz
gdb: remove BLOCKVECTOR_BLOCK and BLOCKVECTOR_NBLOCKS macros
Replace with calls to blockvector::blocks, and the appropriate method call on the returned array_view. Change-Id: I04d1f39603e4d4c21c96822421431d9a029d8ddd
Diffstat (limited to 'gdb/cp-support.c')
-rw-r--r--gdb/cp-support.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 14fad2d453f..f52055893d2 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -1440,7 +1440,7 @@ static void
add_symbol_overload_list_qualified (const char *func_name,
std::vector<symbol *> *overload_list)
{
- const struct block *b, *surrounding_static_block = 0;
+ const struct block *surrounding_static_block = 0;
/* Look through the partial symtabs for all symbols which begin by
matching FUNC_NAME. Make sure we read that symbol table in. */
@@ -1451,7 +1451,9 @@ add_symbol_overload_list_qualified (const char *func_name,
/* Search upwards from currently selected frame (so that we can
complete on local vars. */
- for (b = get_selected_block (0); b != NULL; b = b->superblock ())
+ for (const block *b = get_selected_block (0);
+ b != nullptr;
+ b = b->superblock ())
add_symbol_overload_list_block (func_name, b, overload_list);
surrounding_static_block = block_static_block (get_selected_block (0));
@@ -1464,7 +1466,7 @@ add_symbol_overload_list_qualified (const char *func_name,
for (compunit_symtab *cust : objfile->compunits ())
{
QUIT;
- b = BLOCKVECTOR_BLOCK (cust->blockvector (), GLOBAL_BLOCK);
+ const block *b = cust->blockvector ()->global_block ();
add_symbol_overload_list_block (func_name, b, overload_list);
}
}
@@ -1474,10 +1476,12 @@ add_symbol_overload_list_qualified (const char *func_name,
for (compunit_symtab *cust : objfile->compunits ())
{
QUIT;
- b = BLOCKVECTOR_BLOCK (cust->blockvector (), STATIC_BLOCK);
+ const block *b = cust->blockvector ()->static_block ();
+
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
+
add_symbol_overload_list_block (func_name, b, overload_list);
}
}