See previous patch's commit message for rationale.
Change-Id: I6b8cdc045dffccc1c01ed690ff258af09f6ff076
Approved-By: Tom Tromey <tom@tromey.com>
return range (lower, upper);
}
-cooked_index_vector::cooked_index_vector (vec_type &&vec)
+cooked_index::cooked_index (vec_type &&vec)
: m_vector (std::move (vec))
{
for (auto &idx : m_vector)
/* See cooked-index.h. */
dwarf2_per_cu_data *
-cooked_index_vector::lookup (CORE_ADDR addr)
+cooked_index::lookup (CORE_ADDR addr)
{
for (const auto &index : m_vector)
{
/* See cooked-index.h. */
std::vector<const addrmap *>
-cooked_index_vector::get_addrmaps () const
+cooked_index::get_addrmaps () const
{
std::vector<const addrmap *> result;
for (const auto &index : m_vector)
/* See cooked-index.h. */
-cooked_index_vector::range
-cooked_index_vector::find (const std::string &name, bool completing) const
+cooked_index::range
+cooked_index::find (const std::string &name, bool completing) const
{
std::vector<cooked_index_shard::range> result_range;
result_range.reserve (m_vector.size ());
/* See cooked-index.h. */
const cooked_index_entry *
-cooked_index_vector::get_main () const
+cooked_index::get_main () const
{
const cooked_index_entry *result = nullptr;
/* See cooked-index.h. */
void
-cooked_index_vector::dump (gdbarch *arch) const
+cooked_index::dump (gdbarch *arch) const
{
/* Ensure the index is done building. */
this->wait ();
void write_scope (struct obstack *storage, const char *sep) const;
};
-class cooked_index_vector;
+class cooked_index;
/* An index of interesting DIEs. This is "cooked", in contrast to a
mapped .debug_names or .gdb_index, which are "raw". An entry in
m_future.wait ();
}
- friend class cooked_index_vector;
+ friend class cooked_index;
/* A simple range over part of m_entries. */
typedef iterator_range<std::vector<cooked_index_entry *>::const_iterator>
};
/* The main index of DIEs. The parallel DIE indexers create
- cooked_index objects. Then, these are all handled to a
- cooked_index_vector for storage and final indexing. The index is
+ cooked_index_shard objects. Then, these are all handled to a
+ cooked_index for storage and final indexing. The index is
made by iterating over the entries previously created. */
-class cooked_index_vector : public dwarf_scanner_base
+class cooked_index : public dwarf_scanner_base
{
public:
object. */
using vec_type = std::vector<std::unique_ptr<cooked_index_shard>>;
- explicit cooked_index_vector (vec_type &&vec);
- DISABLE_COPY_AND_ASSIGN (cooked_index_vector);
+ explicit cooked_index (vec_type &&vec);
+ DISABLE_COPY_AND_ASSIGN (cooked_index);
/* Wait until the finalization of the entire cooked_index_vector is
done. */
item->wait ();
}
- ~cooked_index_vector ()
+ ~cooked_index ()
{
/* The 'finalize' methods may be run in a different thread. If
this object is destroyed before these complete, then one will
"main". This will return NULL if no such entry is available. */
const cooked_index_entry *get_main () const;
- cooked_index_vector *index_for_writing () override
+ cooked_index *index_for_writing () override
{
return this;
}
/* Write the contents of the internal "cooked" index. */
static void
-write_cooked_index (cooked_index_vector *table,
+write_cooked_index (cooked_index *table,
const cu_index_map &cu_index_htab,
struct mapped_symtab *symtab)
{
associated dwz file, DWZ_OUT_FILE must be NULL. */
static void
-write_gdbindex (dwarf2_per_objfile *per_objfile,
- cooked_index_vector *table,
+write_gdbindex (dwarf2_per_objfile *per_objfile, cooked_index *table,
FILE *out_file, FILE *dwz_out_file)
{
mapped_symtab symtab;
many bytes were expected to be written into OUT_FILE. */
static void
-write_debug_names (dwarf2_per_objfile *per_objfile,
- cooked_index_vector *table,
+write_debug_names (dwarf2_per_objfile *per_objfile, cooked_index *table,
FILE *out_file, FILE *out_file_str)
{
const bool dwarf5_is_dwarf64 = check_dwarf64_offsets (per_objfile);
if (per_objfile->per_bfd->index_table == nullptr)
error (_("No debugging symbols"));
- cooked_index_vector *table
- = per_objfile->per_bfd->index_table->index_for_writing ();
+ cooked_index *table = per_objfile->per_bfd->index_table->index_for_writing ();
if (per_objfile->per_bfd->types.size () > 1)
error (_("Cannot make an index when the file has multiple .debug_types sections"));
offset_type idx;
};
-class cooked_index_vector;
+class cooked_index;
/* Base class of all DWARF scanner types. */
/* This is called when writing an index. For a cooked index, it
will return 'this' as a cooked index. For other forms, it will
throw an exception with an appropriate error message. */
- virtual cooked_index_vector *index_for_writing () = 0;
+ virtual cooked_index *index_for_writing () = 0;
};
/* Base class containing bits shared by both .gdb_index and
enum language lang,
dwarf2_per_objfile *per_objfile) const;
- cooked_index_vector *index_for_writing () override
+ cooked_index *index_for_writing () override
{
error (_("Cannot use an index to create the index"));
}
indexes.push_back (index_storage.release ());
indexes.shrink_to_fit ();
- cooked_index_vector *vec = new cooked_index_vector (std::move (indexes));
+ cooked_index *vec = new cooked_index (std::move (indexes));
per_bfd->index_table.reset (vec);
const cooked_index_entry *main_entry = vec->get_main ();
void dump (struct objfile *objfile) override
{
dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
- cooked_index_vector *index
- = (gdb::checked_static_cast<cooked_index_vector *>
+ cooked_index *index
+ = (gdb::checked_static_cast<cooked_index *>
(per_objfile->per_bfd->index_table.get ()));
if (index == nullptr)
return;
{
if (per_bfd->index_table == nullptr)
return nullptr;
- cooked_index_vector *table
- = (gdb::checked_static_cast<cooked_index_vector *>
+ cooked_index *table
+ = (gdb::checked_static_cast<cooked_index *>
(per_bfd->index_table.get ()));
return table->lookup (adjusted_pc);
}
return nullptr;
CORE_ADDR baseaddr = objfile->data_section_offset ();
- cooked_index_vector *table
- = (gdb::checked_static_cast<cooked_index_vector *>
+ cooked_index *table
+ = (gdb::checked_static_cast<cooked_index *>
(per_objfile->per_bfd->index_table.get ()));
dwarf2_per_cu_data *per_cu = table->lookup (address - baseaddr);
if (per_cu == nullptr)
symbol_name_matcher_ftype *name_match
= lang->get_symbol_name_matcher (lookup_name);
- cooked_index_vector *table
- = (gdb::checked_static_cast<cooked_index_vector *>
+ cooked_index *table
+ = (gdb::checked_static_cast<cooked_index *>
(per_objfile->per_bfd->index_table.get ()));
for (const cooked_index_entry *entry : table->all_entries ())
{
if (per_objfile->per_bfd->index_table == nullptr)
return true;
- cooked_index_vector *table
- = (gdb::checked_static_cast<cooked_index_vector *>
+ cooked_index *table
+ = (gdb::checked_static_cast<cooked_index *>
(per_objfile->per_bfd->index_table.get ()));
table->wait ();
}
quick_symbol_functions_up
-cooked_index_vector::make_quick_functions () const
+cooked_index::make_quick_functions () const
{
return make_cooked_index_funcs ();
}