diff options
author | Pedro Alves <palves@redhat.com> | 2018-11-21 11:55:13 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2018-11-21 12:06:36 +0000 |
commit | 0891c3cc132495ad7b323896efae4f91eca87c6c (patch) | |
tree | bc1939d0e9e2584a9ffb5e66b5c7e09349e7695d /gdb/cp-support.h | |
parent | 6b1747cd135ff9859fceb6043179b1ef94363996 (diff) | |
download | gdb-0891c3cc132495ad7b323896efae4f91eca87c6c.zip gdb-0891c3cc132495ad7b323896efae4f91eca87c6c.tar.gz gdb-0891c3cc132495ad7b323896efae4f91eca87c6c.tar.bz2 |
Eliminate make_symbol_overload_list-related globals & cleanup
This gets rid of a few globals and a cleanup.
make_symbol_overload_list & friends currently maintain a global
open-coded vector. Reimplement that with a std::vector, trickled down
through the functions. Rename a few functions from "make_" to "add_"
for clarity.
gdb/ChangeLog:
2018-11-21 Pedro Alves <palves@redhat.com>
* cp-support.c (sym_return_val_size, sym_return_val_index)
(sym_return_val): Delete.
(overload_list_add_symbol): Add std::vector parameter. Adjust to
add to the vector.
(make_symbol_overload_list): Adjust to return a std::vector
instead of maintaining a global open coded vector.
(make_symbol_overload_list_block): Add std::vector parameter.
(make_symbol_overload_list_block): Rename to ...
(add_symbol_overload_list_block): ... this and add std::vector
parameter.
(make_symbol_overload_list_namespace): Rename to ...
(add_symbol_overload_list_namespace): ... this and add std::vector
parameter.
(make_symbol_overload_list_adl_namespace): Rename to ...
(add_symbol_overload_list_adl_namespace): ... this and add
std::vector parameter.
(make_symbol_overload_list_adl): Delete.
(add_symbol_overload_list_adl): New.
(make_symbol_overload_list_using): Rename to ...
(add_symbol_overload_list_using): ... this and add std::vector
parameter.
(make_symbol_overload_list_qualified): Rename to ...
(add_symbol_overload_list_qualified): ... this and add std::vector
parameter.
* cp-support.h: Include "common/array-view.h" and <vector>.
(make_symbol_overload_list): Change return type to std::vector.
(make_symbol_overload_list_adl): Delete declaration.
(add_symbol_overload_list_adl): New declaration.
* valops.c (find_overload_match): Local 'oload_syms' now a
std::vector.
(find_oload_champ_namespace): 'oload_syms' parameter now a
std::vector pointer.
(find_oload_champ_namespace_loop): 'oload_syms' parameter now a
std::vector pointer. Adjust to new make_symbol_overload_list
interface.
Diffstat (limited to 'gdb/cp-support.h')
-rw-r--r-- | gdb/cp-support.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/cp-support.h b/gdb/cp-support.h index 4e26921..0402df0 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -28,6 +28,8 @@ #include "vec.h" #include "gdb_vecs.h" #include "gdb_obstack.h" +#include "common/array-view.h" +#include <vector> /* Opaque declarations. */ @@ -107,12 +109,13 @@ extern gdb::unique_xmalloc_ptr<char> cp_remove_params extern gdb::unique_xmalloc_ptr<char> cp_remove_params_if_any (const char *demangled_name, bool completion_mode); -extern struct symbol **make_symbol_overload_list (const char *, - const char *); +extern std::vector<symbol *> make_symbol_overload_list (const char *, + const char *); -extern struct symbol **make_symbol_overload_list_adl (struct type **arg_types, - int nargs, - const char *func_name); +extern void add_symbol_overload_list_adl + (gdb::array_view<type *> arg_types, + const char *func_name, + std::vector<symbol *> *overload_list); extern struct type *cp_lookup_rtti_type (const char *name, struct block *block); |