Convert explicit iterator uses to foreach

This converts most existing explicit uses of block_iterator to use
foreach with the range iterator instead.
This commit is contained in:
Tom Tromey
2023-01-19 20:14:25 -07:00
parent 0f50815c89
commit 1c49bb455c
3 changed files with 5 additions and 17 deletions

View File

@@ -633,14 +633,9 @@ generate_c_for_variable_locations (compile_instance *compiler,
while (1)
{
struct symbol *sym;
struct block_iterator iter;
/* Iterate over symbols in this block, generating code to
compute the location of each local variable. */
for (sym = block_iterator_first (block, &iter);
sym != NULL;
sym = block_iterator_next (&iter))
for (struct symbol *sym : block_iterator_range (block))
{
if (!symbol_seen (symhash.get (), sym))
generate_c_for_for_one_variable (compiler, stream, gdbarch,