]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: remove create_cu_from_index_list
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 3 Mar 2025 21:35:35 +0000 (16:35 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 4 Mar 2025 15:41:54 +0000 (10:41 -0500)
I noticed that create_cu_from_index_list is only used in
read-gdb-index.c, so I started by moving it there.  But given that this
function is use at only one spot and doesn't do much, I opted to inline
its code in the caller instead.

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

index 66d7209c1ddeef8a48c86ed3062d90b47ba7f387..282ac5b4ef4bd4973851cb9cd78a8642a1c42730 100644 (file)
@@ -1324,9 +1324,9 @@ create_cus_from_gdb_index_list (dwarf2_per_bfd *per_bfd,
       ULONGEST length = extract_unsigned_integer (cu_list + 8, 8, BFD_ENDIAN_LITTLE);
       cu_list += 2 * 8;
 
-      dwarf2_per_cu_up per_cu
-       = create_cu_from_index_list (per_bfd, section, is_dwz, sect_off,
-                                    length);
+      dwarf2_per_cu_up per_cu = per_bfd->allocate_per_cu (section, sect_off, length);
+      per_cu->is_dwz = is_dwz;
+
       per_bfd->all_units.push_back (std::move (per_cu));
     }
 }
index b2394588cb8f552cb5b863c7456911c4f340c561..0bef46a10e4b478b9c6e0add23752779ba98a61f 100644 (file)
@@ -1841,20 +1841,6 @@ dwarf2_per_bfd::allocate_signatured_type (dwarf2_section_info *section,
   return result;
 }
 
-/* See read.h.  */
-
-dwarf2_per_cu_up
-create_cu_from_index_list (dwarf2_per_bfd *per_bfd,
-                          struct dwarf2_section_info *section,
-                          int is_dwz,
-                          sect_offset sect_off, ULONGEST length)
-{
-  dwarf2_per_cu_up the_cu
-    = per_bfd->allocate_per_cu (section, sect_off, length);
-  the_cu->is_dwz = is_dwz;
-  return the_cu;
-}
-
 /* die_reader_func for dw2_get_file_names.  */
 
 static void
index 43d0e5d2ebf96880713f6fb6a068b7a83df0ace6..7a98eb4f66e15bf3b57181f7bd5ffa5402cffd7d 100644 (file)
@@ -998,13 +998,6 @@ extern void dw_expand_symtabs_matching_file_matcher
 extern const char *read_indirect_string_at_offset
   (dwarf2_per_objfile *per_objfile, LONGEST str_offset);
 
-/* Return a new dwarf2_per_cu allocated on the per-bfd obstack, and constructed
-   with the specified field values.  */
-
-extern dwarf2_per_cu_up create_cu_from_index_list
-  (dwarf2_per_bfd *per_bfd, struct dwarf2_section_info *section,
-   int is_dwz, sect_offset sect_off, ULONGEST length);
-
 /* Initialize the views on all_units.  */
 
 extern void finalize_all_units (dwarf2_per_bfd *per_bfd);