Skip to content

Commit

Permalink
gdb/dwarf: remove create_cu_from_index_list
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
simark committed Mar 4, 2025
1 parent b55f906 commit 121efb5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
6 changes: 3 additions & 3 deletions gdb/dwarf2/read-gdb-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Expand Down
14 changes: 0 additions & 14 deletions gdb/dwarf2/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions gdb/dwarf2/read.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 121efb5

Please sign in to comment.