]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Rename cooked_index_storage
authorTom Tromey <tom@tromey.com>
Mon, 24 Mar 2025 21:08:37 +0000 (15:08 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 1 Apr 2025 13:30:10 +0000 (07:30 -0600)
This renames cooked_index_storage to cooked_index_worker_result,
making its function more clear.  It also updates the class comment to
as well.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/dwarf2/cooked-index-worker.c
gdb/dwarf2/cooked-index-worker.h
gdb/dwarf2/cooked-indexer.c
gdb/dwarf2/cooked-indexer.h
gdb/dwarf2/read.c

index 4dabe40381f4db43880eae2284853b1b6a9a37a3..8a074a8952f2326d5ed0f3529fac6149ccf030fc 100644 (file)
@@ -21,7 +21,7 @@
 
 /* See cooked-index-worker.h.  */
 
-cooked_index_storage::cooked_index_storage ()
+cooked_index_worker_result::cooked_index_worker_result ()
   : m_shard (new cooked_index_shard)
 {
 }
@@ -29,7 +29,7 @@ cooked_index_storage::cooked_index_storage ()
 /* See cooked-index-worker.h.  */
 
 cutu_reader *
-cooked_index_storage::get_reader (dwarf2_per_cu *per_cu)
+cooked_index_worker_result::get_reader (dwarf2_per_cu *per_cu)
 {
   auto it = m_reader_hash.find (*per_cu);
   return it != m_reader_hash.end () ? it->get () : nullptr;
@@ -38,7 +38,7 @@ cooked_index_storage::get_reader (dwarf2_per_cu *per_cu)
 /* See cooked-index-worker.h.  */
 
 cutu_reader *
-cooked_index_storage::preserve (cutu_reader_up reader)
+cooked_index_worker_result::preserve (cutu_reader_up reader)
 {
   m_abbrev_table_cache.add (reader->release_abbrev_table ());
 
@@ -51,7 +51,7 @@ cooked_index_storage::preserve (cutu_reader_up reader)
 /* See cooked-index-worker.h.  */
 
 std::uint64_t
-cooked_index_storage::cutu_reader_hash::operator()
+cooked_index_worker_result::cutu_reader_hash::operator()
   (const cutu_reader_up &reader) const noexcept
 {
   return (*this) (*reader->cu ()->per_cu);
@@ -60,7 +60,7 @@ cooked_index_storage::cutu_reader_hash::operator()
 /* See cooked-index-worker.h.  */
 
 std::uint64_t
-cooked_index_storage::cutu_reader_hash::operator() (const dwarf2_per_cu &per_cu)
+cooked_index_worker_result::cutu_reader_hash::operator() (const dwarf2_per_cu &per_cu)
   const noexcept
 {
   return per_cu.index;
@@ -69,7 +69,7 @@ cooked_index_storage::cutu_reader_hash::operator() (const dwarf2_per_cu &per_cu)
 /* See cooked-index-worker.h.  */
 
 bool
-cooked_index_storage::cutu_reader_eq::operator() (const cutu_reader_up &a,
+cooked_index_worker_result::cutu_reader_eq::operator() (const cutu_reader_up &a,
                                                  const cutu_reader_up &b) const noexcept
 {
   return (*this) (*a->cu ()->per_cu, b);
@@ -77,7 +77,7 @@ cooked_index_storage::cutu_reader_eq::operator() (const cutu_reader_up &a,
 
 /* See cooked-index-worker.h.  */
 
-bool cooked_index_storage::cutu_reader_eq::operator()
+bool cooked_index_worker_result::cutu_reader_eq::operator()
   (const dwarf2_per_cu &per_cu, const cutu_reader_up &reader) const noexcept
 {
   return per_cu.index == reader->cu ()->per_cu->index;
index 3fca8d1757a838350a37091afda0874505f9332a..ad336338fab30c2b8930223ed0f55f05cc13600b 100644 (file)
@@ -30,14 +30,18 @@ struct dwarf2_per_cu;
 using cutu_reader_up = std::unique_ptr<cutu_reader>;
 
 /* An instance of this is created when scanning DWARF to create a
-   cooked index.  */
+   cooked index.  This class is the result of a single task to store
+   results while working -- that is, it is an implementation detail of
+   the threads managed by cooked_index_worker.  Once scanning is done,
+   selected parts of the state here are stored into the shard, and
+   then these temporary objects are destroyed.  */
 
-class cooked_index_storage
+class cooked_index_worker_result
 {
 public:
 
-  cooked_index_storage ();
-  DISABLE_COPY_AND_ASSIGN (cooked_index_storage);
+  cooked_index_worker_result ();
+  DISABLE_COPY_AND_ASSIGN (cooked_index_worker_result);
 
   /* Return the current abbrev table_cache.  */
   const abbrev_table_cache &get_abbrev_table_cache () const
index 3b8d5e01af01a69ee10c2e765c444c22c0d763a7..1f3a2357958f04e75ba4674c17464ddc14b64dab 100644 (file)
@@ -23,7 +23,7 @@
 
 /* See cooked-indexer.h.  */
 
-cooked_indexer::cooked_indexer (cooked_index_storage *storage,
+cooked_indexer::cooked_indexer (cooked_index_worker_result *storage,
                                dwarf2_per_cu *per_cu, enum language language)
   : m_index_storage (storage),
     m_per_cu (per_cu),
index 93626a9fb31d99a34679c6e224fd133c30670273..99e9fddd9ba97544da75c3e08505ff3a60807969 100644 (file)
@@ -26,7 +26,7 @@
 #include <variant>
 
 struct abbrev_info;
-struct cooked_index_storage;
+struct cooked_index_worker_result;
 struct cutu_reader;
 struct dwarf2_per_cu;
 struct dwarf2_per_objfile;
@@ -36,7 +36,7 @@ struct dwarf2_per_objfile;
 class cooked_indexer
 {
 public:
-  cooked_indexer (cooked_index_storage *storage, dwarf2_per_cu *per_cu,
+  cooked_indexer (cooked_index_worker_result *storage, dwarf2_per_cu *per_cu,
                  enum language language);
 
   DISABLE_COPY_AND_ASSIGN (cooked_indexer);
@@ -103,7 +103,7 @@ private:
                           bool fully);
 
   /* The storage object, where the results are kept.  */
-  cooked_index_storage *m_index_storage;
+  cooked_index_worker_result *m_index_storage;
   /* The CU that we are reading on behalf of.  This object might be
      asked to index one CU but to treat the results as if they come
      from some including CU; in this case the including CU would be
index d02a515abb5575a1ce995d8142d0ec0f4f01c5a6..fc079cd1520571876308ca67e4e9ae307c8a4424 100644 (file)
@@ -728,7 +728,7 @@ show_dwarf_synchronous (struct ui_file *file, int from_tty,
 /* local function prototypes */
 
 static void build_type_psymtabs_reader (cutu_reader *reader,
-                                       cooked_index_storage *storage);
+                                       cooked_index_worker_result *storage);
 
 static void var_decode_location (struct attribute *attr,
                                 struct symbol *sym,
@@ -3289,7 +3289,7 @@ get_type_unit_group_key (struct dwarf2_cu *cu, const struct attribute *stmt_list
 static void
 process_psymtab_comp_unit (dwarf2_per_cu *this_cu,
                           dwarf2_per_objfile *per_objfile,
-                          cooked_index_storage *storage)
+                          cooked_index_worker_result *storage)
 {
   cutu_reader *reader = storage->get_reader (this_cu);
   if (reader == nullptr)
@@ -3326,7 +3326,7 @@ process_psymtab_comp_unit (dwarf2_per_cu *this_cu,
 
 static void
 build_type_psymtabs_reader (cutu_reader *reader,
-                           cooked_index_storage *storage)
+                           cooked_index_worker_result *storage)
 {
   struct dwarf2_cu *cu = reader->cu ();
   dwarf2_per_cu *per_cu = cu->per_cu;
@@ -3379,7 +3379,7 @@ struct tu_abbrev_offset
 
 static void
 build_type_psymtabs (dwarf2_per_objfile *per_objfile,
-                    cooked_index_storage *storage)
+                    cooked_index_worker_result *storage)
 {
   struct tu_stats *tu_stats = &per_objfile->per_bfd->tu_stats;
   abbrev_table_up abbrev_table;
@@ -3476,7 +3476,7 @@ print_tu_stats (dwarf2_per_objfile *per_objfile)
 static void
 process_skeletonless_type_unit (dwo_unit *dwo_unit,
                                dwarf2_per_objfile *per_objfile,
-                               cooked_index_storage *storage)
+                               cooked_index_worker_result *storage)
 {
   dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
 
@@ -3507,7 +3507,7 @@ process_skeletonless_type_unit (dwo_unit *dwo_unit,
 
 static void
 process_skeletonless_type_units (dwarf2_per_objfile *per_objfile,
-                                cooked_index_storage *storage)
+                                cooked_index_worker_result *storage)
 {
   /* Skeletonless TUs in DWP files without .gdb_index is not supported yet.  */
   if (get_dwp_file (per_objfile) == nullptr)
@@ -3567,7 +3567,7 @@ private:
   /* A storage object for "leftovers" -- see the 'start' method, but
      essentially things not parsed during the normal CU parsing
      passes.  */
-  cooked_index_storage m_index_storage;
+  cooked_index_worker_result m_index_storage;
 };
 
 void
@@ -3580,7 +3580,7 @@ cooked_index_worker_debug_info::process_cus (size_t task_number, unit_iterator f
   complaint_interceptor complaint_handler;
 
   std::vector<gdb_exception> errors;
-  cooked_index_storage thread_storage;
+  cooked_index_worker_result thread_storage;
   for (auto inner = first; inner != end; ++inner)
     {
       dwarf2_per_cu *per_cu = inner->get ();