[03/19] Use gdb unordered map in dictionary.c

Message ID 20250317-replace-std-stuff-v1-3-7ba4ee88e218@tromey.com
State New
Headers
Series Convert std::unordered_{set,map} to gdb implementations |

Commit Message

Tom Tromey March 18, 2025, 2:14 a.m. UTC
  This changes dictionary.c to use gdb::unordered_map.
---
 gdb/dictionary.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Patch

diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index f617b8f967f87b9c177d5470158b02c91986e531..f673877338c9b012ed9b7a149e6086975604a5bf 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -26,7 +26,7 @@ 
 #include "buildsym.h"
 #include "dictionary.h"
 #include "gdbsupport/gdb-safe-ctype.h"
-#include <unordered_map>
+#include "gdbsupport/unordered_map.h"
 #include "language.h"
 
 /* This file implements dictionaries, which are tables that associate
@@ -917,10 +917,10 @@  struct multidictionary
 
 /* A helper function to collate symbols on the pending list by language.  */
 
-static std::unordered_map<enum language, std::vector<symbol *>>
+static gdb::unordered_map<enum language, std::vector<symbol *>>
 collate_pending_symbols_by_language (const struct pending *symbol_list)
 {
-  std::unordered_map<enum language, std::vector<symbol *>> nsyms;
+  gdb::unordered_map<enum language, std::vector<symbol *>> nsyms;
 
   for (const pending *list_counter = symbol_list;
        list_counter != nullptr; list_counter = list_counter->next)
@@ -943,7 +943,7 @@  mdict_create_hashed (struct obstack *obstack,
 {
   struct multidictionary *retval
     = XOBNEW (obstack, struct multidictionary);
-  std::unordered_map<enum language, std::vector<symbol *>> nsyms
+  gdb::unordered_map<enum language, std::vector<symbol *>> nsyms
     = collate_pending_symbols_by_language (symbol_list);
 
   /* Loop over all languages and create/populate dictionaries.  */
@@ -988,7 +988,7 @@  mdict_create_linear (struct obstack *obstack,
 {
   struct multidictionary *retval
     = XOBNEW (obstack, struct multidictionary);
-  std::unordered_map<enum language, std::vector<symbol *>> nsyms
+  gdb::unordered_map<enum language, std::vector<symbol *>> nsyms
     = collate_pending_symbols_by_language (symbol_list);
 
   /* Loop over all languages and create/populate dictionaries.  */
@@ -1132,7 +1132,7 @@  void
 mdict_add_pending (struct multidictionary *mdict,
 		   const struct pending *symbol_list)
 {
-  std::unordered_map<enum language, std::vector<symbol *>> nsyms
+  gdb::unordered_map<enum language, std::vector<symbol *>> nsyms
     = collate_pending_symbols_by_language (symbol_list);
 
   for (const auto &pair : nsyms)