[01/11] Rename cooked-index-storage.[ch]

Message ID 20250325-header-explosion-v1-1-92b7d68c086e@tromey.com
State New
Headers
Series Remove cooked_index_worker::result_type |

Commit Message

Tom Tromey March 26, 2025, 12:56 a.m. UTC
  A discussion with Simon made me realize that cooked_index_storage
isn't a very clear name, especially now that it's escaped from read.c.
While it does provide some storage (I guess any object does in a
sense), it is really a helper for cooked_index_worker -- a temporary
object that is destroyed after reading has completed.

This patch renames this file.  Later patches will rename the class and
move cooked_index_worker here, something I think is reasonable given
that cooked_index_storage is really something of a helper class for
cooked_index_worker.
---
 gdb/Makefile.in                                          |  4 ++--
 .../{cooked-index-storage.c => cooked-index-worker.c}    | 16 ++++++++--------
 .../{cooked-index-storage.h => cooked-index-worker.h}    |  6 +++---
 gdb/dwarf2/cooked-indexer.c                              |  2 +-
 gdb/dwarf2/read.c                                        |  2 +-
 5 files changed, 15 insertions(+), 15 deletions(-)
  

Patch

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 8f6df5ba7b6ce2d107cf3e5ddbe9e3258f6c2d3e..4bb5a11180da2fc0b871dc884c0ae1da87b6939a 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1097,7 +1097,7 @@  COMMON_SFILES = \
 	dwarf2/attribute.c \
 	dwarf2/comp-unit-head.c \
 	dwarf2/cooked-index.c \
-	dwarf2/cooked-index-storage.c \
+	dwarf2/cooked-index-worker.c \
 	dwarf2/cooked-indexer.c \
 	dwarf2/cu.c \
 	dwarf2/die.c \
@@ -1356,7 +1356,7 @@  HFILES_NO_SRCDIR = \
 	dummy-frame.h \
 	dwarf2/aranges.h \
 	dwarf2/cooked-index.h \
-	dwarf2/cooked-index-storage.h \
+	dwarf2/cooked-index-worker.h \
 	dwarf2/cooked-indexer.h \
 	dwarf2/cu.h \
 	dwarf2/frame-tailcall.h \
diff --git a/gdb/dwarf2/cooked-index-storage.c b/gdb/dwarf2/cooked-index-worker.c
similarity index 87%
rename from gdb/dwarf2/cooked-index-storage.c
rename to gdb/dwarf2/cooked-index-worker.c
index 9c05cf5b7173439dac9bdea232ab5b34cc24afc2..4dabe40381f4db43880eae2284853b1b6a9a37a3 100644
--- a/gdb/dwarf2/cooked-index-storage.c
+++ b/gdb/dwarf2/cooked-index-worker.c
@@ -17,16 +17,16 @@ 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include "dwarf2/cooked-index-storage.h"
+#include "dwarf2/cooked-index-worker.h"
 
-/* See cooked-index-storage.h.  */
+/* See cooked-index-worker.h.  */
 
 cooked_index_storage::cooked_index_storage ()
   : m_shard (new cooked_index_shard)
 {
 }
 
-/* See cooked-index-storage.h.  */
+/* See cooked-index-worker.h.  */
 
 cutu_reader *
 cooked_index_storage::get_reader (dwarf2_per_cu *per_cu)
@@ -35,7 +35,7 @@  cooked_index_storage::get_reader (dwarf2_per_cu *per_cu)
   return it != m_reader_hash.end () ? it->get () : nullptr;
 }
 
-/* See cooked-index-storage.h.  */
+/* See cooked-index-worker.h.  */
 
 cutu_reader *
 cooked_index_storage::preserve (cutu_reader_up reader)
@@ -48,7 +48,7 @@  cooked_index_storage::preserve (cutu_reader_up reader)
   return it->get();
 }
 
-/* See cooked-index-storage.h.  */
+/* See cooked-index-worker.h.  */
 
 std::uint64_t
 cooked_index_storage::cutu_reader_hash::operator()
@@ -57,7 +57,7 @@  cooked_index_storage::cutu_reader_hash::operator()
   return (*this) (*reader->cu ()->per_cu);
 }
 
-/* See cooked-index-storage.h.  */
+/* See cooked-index-worker.h.  */
 
 std::uint64_t
 cooked_index_storage::cutu_reader_hash::operator() (const dwarf2_per_cu &per_cu)
@@ -66,7 +66,7 @@  cooked_index_storage::cutu_reader_hash::operator() (const dwarf2_per_cu &per_cu)
   return per_cu.index;
 }
 
-/* See cooked-index-storage.h.  */
+/* See cooked-index-worker.h.  */
 
 bool
 cooked_index_storage::cutu_reader_eq::operator() (const cutu_reader_up &a,
@@ -75,7 +75,7 @@  cooked_index_storage::cutu_reader_eq::operator() (const cutu_reader_up &a,
   return (*this) (*a->cu ()->per_cu, b);
 }
 
-/* See cooked-index-storage.h.  */
+/* See cooked-index-worker.h.  */
 
 bool cooked_index_storage::cutu_reader_eq::operator()
   (const dwarf2_per_cu &per_cu, const cutu_reader_up &reader) const noexcept
diff --git a/gdb/dwarf2/cooked-index-storage.h b/gdb/dwarf2/cooked-index-worker.h
similarity index 96%
rename from gdb/dwarf2/cooked-index-storage.h
rename to gdb/dwarf2/cooked-index-worker.h
index 449fbe17ad1d949226db52d45f6f73c9140721bf..3fca8d1757a838350a37091afda0874505f9332a 100644
--- a/gdb/dwarf2/cooked-index-storage.h
+++ b/gdb/dwarf2/cooked-index-worker.h
@@ -17,8 +17,8 @@ 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef GDB_DWARF2_COOKED_INDEX_STORAGE_H
-#define GDB_DWARF2_COOKED_INDEX_STORAGE_H
+#ifndef GDB_DWARF2_COOKED_INDEX_WORKER_H
+#define GDB_DWARF2_COOKED_INDEX_WORKER_H
 
 #include "dwarf2/abbrev-table-cache.h"
 #include "dwarf2/cooked-index.h"
@@ -128,4 +128,4 @@  class cooked_index_storage
   addrmap_mutable m_addrmap;
 };
 
-#endif /* GDB_DWARF2_COOKED_INDEX_STORAGE_H */
+#endif /* GDB_DWARF2_COOKED_INDEX_WORKER_H */
diff --git a/gdb/dwarf2/cooked-indexer.c b/gdb/dwarf2/cooked-indexer.c
index 3b80cd6c50089c82963881845713b93655b25ec4..ca194e834a19d874d8a356127c373ee544724a64 100644
--- a/gdb/dwarf2/cooked-indexer.c
+++ b/gdb/dwarf2/cooked-indexer.c
@@ -18,7 +18,7 @@ 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "dwarf2/cooked-indexer.h"
-#include "dwarf2/cooked-index-storage.h"
+#include "dwarf2/cooked-index-worker.h"
 #include "dwarf2/error.h"
 
 /* See cooked-indexer.h.  */
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index ff4f388daca9edf2d3cb1fd9238482aafb193009..45fb86d846a889fd945ab3aa5b9625e647f46fa5 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -32,7 +32,7 @@ 
 #include "dwarf2/aranges.h"
 #include "dwarf2/attribute.h"
 #include "dwarf2/comp-unit-head.h"
-#include "dwarf2/cooked-index-storage.h"
+#include "dwarf2/cooked-index-worker.h"
 #include "dwarf2/cooked-indexer.h"
 #include "dwarf2/cu.h"
 #include "dwarf2/index-cache.h"