Return a vector from ada_lookup_symbol_list
authorTom Tromey <tromey@adacore.com>
Tue, 2 Mar 2021 20:00:45 +0000 (13:00 -0700)
committerTom Tromey <tromey@adacore.com>
Tue, 2 Mar 2021 20:00:45 +0000 (13:00 -0700)
commitd1183b064cae59353c3a80d27dc250ca440cb879
tree3c785263d8956cffeacc78319fd7dace968f3daa
parent886d459fbea73da4b07bae37f4526b766cbd90e8
Return a vector from ada_lookup_symbol_list

This changes ada_lookup_symbol_list to return a std::vector, and
changes various other helper functions to follow.  This simplifies the
code, and makes it more type-safe (by using a vector where an obstack
had been used).

gdb/ChangeLog
2021-03-02  Tom Tromey  <tromey@adacore.com>

* ada-lang.h (ada_lookup_symbol_list): Return a vector.
* ada-lang.c (resolve_subexp): Update.
(ada_resolve_function): Accept a vector.
(is_nonfunction, add_defn_to_vec)
(add_symbols_from_enclosing_procs): Likewise.
(num_defns_collected, defns_collected): Remove.
(remove_extra_symbols): Return a vector.
(remove_irrelevant_renamings): Return void.
(ada_add_local_symbols): Accept a vector.
(struct match_data) <obstackp>: Remove.
<resultp>: New member.
(aux_add_nonlocal_symbols): Update.
(ada_add_block_renamings, add_nonlocal_symbols)
(ada_add_all_symbols): Accept a vector.
(ada_lookup_symbol_list_worker, ada_lookup_symbol_list): Return a
vector.
(ada_lookup_symbol): Update.
(ada_add_block_symbols): Accept a vector.
(get_var_value, iterate_over_symbols): Update.
* ada-exp.y (block_lookup, write_var_or_type, write_name_assoc):
Update.
gdb/ChangeLog
gdb/ada-exp.y
gdb/ada-lang.c
gdb/ada-lang.h