diff options
author | Tom Tromey <tom@tromey.com> | 2025-03-13 16:42:53 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2025-03-18 05:32:33 -0600 |
commit | b5b4ed06aa30446093c4b31f7a9116e266b9026d (patch) | |
tree | 57a1fc980d774e148da6c72737c12c88f2ca0602 /gdb | |
parent | 478d549db531b8d4b94d7e65965a3760a1e3358d (diff) | |
download | binutils-b5b4ed06aa30446093c4b31f7a9116e266b9026d.zip binutils-b5b4ed06aa30446093c4b31f7a9116e266b9026d.tar.gz binutils-b5b4ed06aa30446093c4b31f7a9116e266b9026d.tar.bz2 |
Use gdb unordered set and map in cp-namespace.c
This changes cp-namespace.c to use gdb::unordered_map.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/cp-namespace.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index dc018a2..370cb36 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -32,7 +32,7 @@ #include "language.h" #include "namespace.h" #include "inferior.h" -#include <map> +#include "gdbsupport/unordered_map.h" #include <string> #include <string.h> @@ -352,6 +352,9 @@ cp_lookup_symbol_in_namespace (const char *the_namespace, const char *name, return sym; } +/* Type used for collecting symbols. Maps names to symbols. */ +using symbol_map = gdb::unordered_map<std::string, block_symbol>; + /* This version of the function is internal, use the wrapper unless the list of ambiguous symbols is needed. @@ -391,8 +394,7 @@ cp_lookup_symbol_via_imports (const char *scope, const int search_scope_first, const int declaration_only, const int search_parents, - std::map<std::string, - struct block_symbol>& found_symbols) + symbol_map &found_symbols) { struct block_symbol sym = {}; int len; @@ -509,7 +511,7 @@ cp_lookup_symbol_via_imports (const char *scope, const int declaration_only, const int search_parents) { - std::map<std::string, struct block_symbol> found_symbols; + symbol_map found_symbols; cp_lookup_symbol_via_imports(scope, name, block, domain, 0, declaration_only, search_parents, |