]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: std::unordered_{set,map} -> gdb::unordered_{set,map} throughout
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 17 Feb 2025 19:59:30 +0000 (14:59 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 19 Feb 2025 16:14:41 +0000 (11:14 -0500)
No behavior changes expected.

Change-Id: I16ff6c67058362c65cc8edb05d1948e48be6b2e1
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/aranges.c
gdb/dwarf2/cooked-index.c
gdb/dwarf2/frame.c
gdb/dwarf2/index-write.c
gdb/dwarf2/loc.c
gdb/dwarf2/read-debug-names.c
gdb/dwarf2/read.c
gdb/dwarf2/read.h

index af14f82126b1b5e596f67a62afa887afbe1fd1d8..b9903084416fb30c1b87c4d83620e90570f1e86d 100644 (file)
@@ -39,7 +39,7 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
   struct gdbarch *gdbarch = objfile->arch ();
   dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
 
-  std::unordered_map<sect_offset, dwarf2_per_cu_data *>
+  gdb::unordered_map<sect_offset, dwarf2_per_cu_data *>
     debug_info_offset_to_per_cu;
   for (const auto &per_cu : per_bfd->all_units)
     {
index d7b5a6837adf592502d779ef33ad54a2edb74342..6c6839cde9ba279dcd7040748120e1c3cd31c2e7 100644 (file)
 #include "gdbsupport/task-group.h"
 #include "gdbsupport/thread-pool.h"
 #include <chrono>
-#include <unordered_set>
 #include "cli/cli-cmds.h"
 
 /* We don't want gdb to exit while it is in the process of writing to
    the index cache.  So, all live cooked index vectors are stored
    here, and then these are all waited for before exit proceeds.  */
-static std::unordered_set<cooked_index *> active_vectors;
+static gdb::unordered_set<cooked_index *> active_vectors;
 
 /* See cooked-index.h.  */
 
@@ -547,7 +546,7 @@ cooked_index_worker::wait (cooked_state desired_state, bool allow_quit)
     }
 
   /* Only show a given exception a single time.  */
-  std::unordered_set<gdb_exception> seen_exceptions;
+  gdb::unordered_set<gdb_exception> seen_exceptions;
   for (auto &one_result : m_results)
     {
       re_emit_complaints (std::get<1> (one_result));
index 03e973eb902e046cae085470108092dbcdefaf62..17f3932a99020c2eb43fc6fb3fafdea89e602601 100644 (file)
@@ -44,7 +44,6 @@
 #include "gdbsupport/selftest.h"
 #include "selftest-arch.h"
 #endif
-#include <unordered_map>
 
 #include <algorithm>
 
@@ -104,7 +103,7 @@ struct dwarf2_cie
 
 /* The CIE table is used to find CIEs during parsing, but then
    discarded.  It maps from the CIE's offset to the CIE.  */
-typedef std::unordered_map<ULONGEST, dwarf2_cie *> dwarf2_cie_table;
+using dwarf2_cie_table = gdb::unordered_map<ULONGEST, dwarf2_cie *>;
 
 /* Frame Description Entry (FDE).  */
 
index f36f388cfa47466e5f03bb037a9f29128e00f142..334f9f8efeba7dd45ec9a04ac8c260fa8c81f738 100644 (file)
@@ -43,8 +43,6 @@
 
 #include <algorithm>
 #include <map>
-#include <unordered_map>
-#include <unordered_set>
 
 /* Ensure only legit values are used.  */
 #define DW2_GDB_INDEX_SYMBOL_STATIC_SET_VALUE(cu_index, value) \
@@ -432,7 +430,7 @@ symtab_index_entry::minimize ()
      this, we want to keep the entry from the first CU -- but this is
      implicit due to the sort.  This choice is done because it's
      similar to what gdb historically did for partial symbols.  */
-  std::unordered_set<offset_type> seen;
+  gdb::unordered_set<offset_type> seen;
   from = std::remove_if (cu_indices.begin (), cu_indices.end (),
                         [&] (offset_type val)
     {
@@ -478,7 +476,7 @@ private:
   const char *const m_cstr;
 };
 
-/* A std::unordered_map::hasher for c_str_view that uses the right
+/* A gdb::unordered_map::hasher for c_str_view that uses the right
    hash function for strings in a mapped index.  */
 class c_str_view_hasher
 {
@@ -489,7 +487,7 @@ public:
   }
 };
 
-/* A std::unordered_map::hasher for std::vector<>.  */
+/* A gdb::unordered_map::hasher for std::vector<>.  */
 template<typename T>
 class vector_hasher
 {
@@ -510,7 +508,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool)
   {
     /* Elements are sorted vectors of the indices of all the CUs that
        hold an object of this name.  */
-    std::unordered_map<std::vector<offset_type>, offset_type,
+    gdb::unordered_map<std::vector<offset_type>, offset_type,
                       vector_hasher<offset_type>>
       symbol_hash_table;
 
@@ -537,7 +535,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool)
   }
 
   /* Now write out the hash table.  */
-  std::unordered_map<c_str_view, offset_type, c_str_view_hasher> str_table;
+  gdb::unordered_map<c_str_view, offset_type, c_str_view_hasher> str_table;
   for (const auto &entry : *symtab)
     {
       offset_type str_off, vec_off;
@@ -564,7 +562,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool)
 }
 
 using cu_index_map
-  = std::unordered_map<const dwarf2_per_cu_data *, unsigned int>;
+  = gdb::unordered_map<const dwarf2_per_cu_data *, unsigned int>;
 
 /* Helper struct for building the address table.  */
 struct addrmap_index_data
@@ -924,7 +922,7 @@ private:
     }
 
   private:
-    std::unordered_map<c_str_view, size_t, c_str_view_hasher> m_str_table;
+    gdb::unordered_map<c_str_view, size_t, c_str_view_hasher> m_str_table;
     bfd *const m_abfd;
     dwarf2_per_bfd *m_per_bfd;
 
@@ -963,7 +961,7 @@ private:
     const bool has_parent;
   };
 
-  /* Provide std::unordered_map::hasher for index_key.  */
+  /* Provide gdb::unordered_map::hasher for index_key.  */
   class index_key_hasher
   {
   public:
@@ -1103,7 +1101,7 @@ private:
 
   /* Map each used .debug_names abbreviation tag parameter to its
      index value.  */
-  std::unordered_map<index_key, int, index_key_hasher> m_indexkey_to_idx;
+  gdb::unordered_map<index_key, int, index_key_hasher> m_indexkey_to_idx;
 
   /* .debug_names abbreviation table.  */
   data_buf m_abbrev_table;
index a01161e83f7d75816aa791f51bd38d8830706b0a..585b5de8c9d826c5f581a9569941b555ea0c00e1 100644 (file)
@@ -43,7 +43,6 @@
 #include "compile/compile.h"
 #include <algorithm>
 #include <vector>
-#include <unordered_set>
 #include "gdbsupport/underlying.h"
 #include "gdbsupport/byte-vector.h"
 #include "extract-store-integer.h"
@@ -795,7 +794,7 @@ func_verify_no_selftailcall (struct gdbarch *gdbarch, CORE_ADDR verify_addr)
   std::vector<CORE_ADDR> todo;
 
   /* Track here CORE_ADDRs which were already visited.  */
-  std::unordered_set<CORE_ADDR> addr_hash;
+  gdb::unordered_set<CORE_ADDR> addr_hash;
 
   todo.push_back (verify_addr);
   while (!todo.empty ())
@@ -964,7 +963,7 @@ call_site_find_chain_2
      (struct gdbarch *gdbarch,
       gdb::unique_xmalloc_ptr<struct call_site_chain> *resultp,
       std::vector<struct call_site *> &chain,
-      std::unordered_set<CORE_ADDR> &addr_hash,
+      gdb::unordered_set<CORE_ADDR> &addr_hash,
       struct call_site *call_site,
       CORE_ADDR callee_pc)
 {
@@ -1047,7 +1046,7 @@ call_site_find_chain_1 (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
                 paddress (gdbarch, save_callee_pc));
 
   /* Mark CALL_SITEs so we do not visit the same ones twice.  */
-  std::unordered_set<CORE_ADDR> addr_hash;
+  gdb::unordered_set<CORE_ADDR> addr_hash;
 
   /* Do not push CALL_SITE to CHAIN.  Push there only the first tail call site
      at the target's function.  All the possible tail call sites in the
@@ -1841,7 +1840,7 @@ dwarf2_get_symbol_read_needs (gdb::array_view<const gdb_byte> expr,
   std::vector<const gdb_byte *> ops_to_visit;
 
   /* Operations already visited.  */
-  std::unordered_set<const gdb_byte *> visited_ops;
+  gdb::unordered_set<const gdb_byte *> visited_ops;
 
   /* Insert OP in OPS_TO_VISIT if it is within the expression's range and
      hasn't been visited yet.  */
index 5383cf2feeed5a08a25ea4aac2c8939424db0637..924b570a5f401e41d9b9926abf8f3a14585231d2 100644 (file)
@@ -112,7 +112,7 @@ struct mapped_debug_names_reader
     std::vector<attr> attr_vec;
   };
 
-  std::unordered_map<ULONGEST, index_val> abbrev_map;
+  gdb::unordered_map<ULONGEST, index_val> abbrev_map;
 
   /* Even though the scanning of .debug_names and creation of the cooked index
      entries is done serially, we create multiple shards so that the
index 347d71ddf262bb87f0a23bb577b2aba2c10c33d8..b3f56c2278242f791b43858e97029b02dff61cc5 100644 (file)
 #include "producer.h"
 #include <fcntl.h>
 #include <algorithm>
-#include <unordered_map>
 #include "gdbsupport/selftest.h"
 #include "rust-lang.h"
 #include "gdbsupport/pathstuff.h"
 #include "count-one-bits.h"
-#include <unordered_set>
 #include "dwarf2/abbrev-table-cache.h"
 #include "cooked-index.h"
 #include "gdbsupport/thread-pool.h"
@@ -2289,7 +2287,7 @@ dwarf2_base_index_functions::map_symbol_filenames
 
   /* Use caches to ensure we only call FUN once for each filename.  */
   filename_seen_cache filenames_cache;
-  std::unordered_set<quick_file_names *> qfn_cache;
+  gdb::unordered_set<quick_file_names *> qfn_cache;
 
   /* The rule is CUs specify all the files, including those used by any TU,
      so there's no need to scan TUs here.  We can ignore file names coming
@@ -5251,7 +5249,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
       /* We need a way to find the correct discriminant given a
         variant name.  For convenience we build a map here.  */
       struct type *enum_type = disr_field->type ();
-      std::unordered_map<std::string_view, ULONGEST> discriminant_map;
+      gdb::unordered_map<std::string_view, ULONGEST> discriminant_map;
       for (int i = 0; i < enum_type->num_fields (); ++i)
        {
          if (enum_type->field (i).loc_kind () == FIELD_LOC_KIND_ENUMVAL)
@@ -11270,7 +11268,7 @@ dwarf2_add_type_defn (struct field_info *fip, struct die_info *die,
 
 /* A convenience typedef that's used when finding the discriminant
    field for a variant part.  */
-typedef std::unordered_map<sect_offset, int> offset_map_type;
+using offset_map_type = gdb::unordered_map<sect_offset, int>;
 
 /* Compute the discriminant range for a given variant.  OBSTACK is
    where the results will be stored.  VARIANT is the variant to
index 640a8e2e3914964a13675047a7788a59ea519f77..23cb506d54d7cf13374da162a46ce8837fe0dfbc 100644 (file)
@@ -21,7 +21,6 @@
 #define GDB_DWARF2_READ_H
 
 #include <queue>
-#include <unordered_map>
 #include "dwarf2/comp-unit-head.h"
 #include "dwarf2/file-and-dir.h"
 #include "dwarf2/index-cache.h"
@@ -563,7 +562,7 @@ public:
 
   /* Mapping from abstract origin DIE to concrete DIEs that reference it as
      DW_AT_abstract_origin.  */
-  std::unordered_map<sect_offset, std::vector<sect_offset>>
+  gdb::unordered_map<sect_offset, std::vector<sect_offset>>
     abstract_to_concrete;
 
   /* Current directory, captured at the moment that object this was
@@ -793,17 +792,17 @@ private:
      that the CU/TU has not been expanded yet.  */
   std::vector<compunit_symtab *> m_symtabs;
 
- /* Map from a type unit group to the corresponding unshared
-    structure.  */
-  std::unordered_map<type_unit_group *, type_unit_group_unshareable_up>
 /* Map from a type unit group to the corresponding unshared
+     structure.  */
+  gdb::unordered_map<type_unit_group *, type_unit_group_unshareable_up>
     m_type_units;
 
   /* Map from signatured types to the corresponding struct type.  */
-  std::unordered_map<signatured_type *, struct type *> m_type_map;
+  gdb::unordered_map<signatured_type *, struct type *> m_type_map;
 
   /* Map from the objfile-independent dwarf2_per_cu_data instances to the
      corresponding objfile-dependent dwarf2_cu instances.  */
-  std::unordered_map<dwarf2_per_cu_data *, dwarf2_cu_up> m_dwarf2_cus;
+  gdb::unordered_map<dwarf2_per_cu_data *, dwarf2_cu_up> m_dwarf2_cus;
 };
 
 /* Converts DWARF language names to GDB language names.  */