]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: remove cooked_index::vec_type
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 10 Feb 2025 16:54:57 +0000 (11:54 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 11 Feb 2025 15:10:31 +0000 (10:10 -0500)
I find this typedef to be confusing.  The name is a bit too generic, so
it's not clear what it represents.  When using the typedef for a
cooked_index_shard unique pointer, I think that spelling out the vector
type is not overly long.

Change-Id: I99fdab5cd925c37c3835b466ce40ec9c1ec7209d
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/cooked-index.c
gdb/dwarf2/cooked-index.h

index e09be98ea8e62c23ab49865c20c2898ed58b4c6e..0aaa405ec1aa2277f95e51f384c8678a29499682 100644 (file)
@@ -647,7 +647,8 @@ cooked_index::wait (cooked_state desired_state, bool allow_quit)
 }
 
 void
-cooked_index::set_contents (vec_type &&vec, deferred_warnings *warn,
+cooked_index::set_contents (std::vector<cooked_index_shard_up> &&vec,
+                           deferred_warnings *warn,
                            const parent_map_map *parent_maps)
 {
   gdb_assert (m_vector.empty ());
index 8c2cc76fee15eaaca797d6310bf31fcf80a95f1e..43ac9531251e0ef4e86749968b27ee6ca35103f5 100644 (file)
@@ -626,11 +626,6 @@ protected:
 class cooked_index : public dwarf_scanner_base
 {
 public:
-
-  /* A convenience typedef for the vector that is contained in this
-     object.  */
-  using vec_type = std::vector<std::unique_ptr<cooked_index_shard>>;
-
   cooked_index (dwarf2_per_objfile *per_objfile,
                std::unique_ptr<cooked_index_worker> &&worker);
   ~cooked_index () override;
@@ -646,7 +641,8 @@ public:
      PARENT_MAPS is used when resolving pending parent links.
      PARENT_MAPS may be NULL if there are no IS_PARENT_DEFERRED
      entries in VEC.  */
-  void set_contents (vec_type &&vec, deferred_warnings *warn,
+  void set_contents (std::vector<cooked_index_shard_up> &&vec,
+                    deferred_warnings *warn,
                     const parent_map_map *parent_maps);
 
   /* A range over a vector of subranges.  */
@@ -714,7 +710,7 @@ private:
 
   /* The vector of cooked_index objects.  This is stored because the
      entries are stored on the obstacks in those objects.  */
-  vec_type m_vector;
+  std::vector<cooked_index_shard_up> m_vector;
 
   /* This tracks the current state.  When this is nullptr, it means
      that the state is CACHE_DONE -- it's important to note that only