index_table->wait_completely ();
for (auto &per_cu : all_units)
- {
- per_cu->imported_symtabs_free ();
- per_cu->free_cached_file_names ();
- }
+ per_cu->free_cached_file_names ();
/* Everything else should be on this->obstack. */
}
}
}
- if (!per_cu->imported_symtabs_empty ())
- for (dwarf2_per_cu_data *ptr : *per_cu->imported_symtabs)
- {
- recursively_compute_inclusions (result, all_children,
- all_type_symtabs, ptr, per_objfile,
- cust);
- }
+ for (dwarf2_per_cu_data *ptr : per_cu->imported_symtabs)
+ recursively_compute_inclusions (result, all_children,
+ all_type_symtabs, ptr, per_objfile,
+ cust);
}
/* Compute the compunit_symtab 'includes' fields for the compunit_symtab of
{
gdb_assert (! per_cu->is_debug_types);
- if (!per_cu->imported_symtabs_empty ())
+ if (!per_cu->imported_symtabs.empty ())
{
int len;
std::vector<compunit_symtab *> result_symtabs;
htab_eq_pointer,
NULL, xcalloc, xfree));
- for (dwarf2_per_cu_data *ptr : *per_cu->imported_symtabs)
- {
- recursively_compute_inclusions (&result_symtabs, all_children.get (),
- all_type_symtabs.get (), ptr,
- per_objfile, cust);
- }
+ for (dwarf2_per_cu_data *ptr : per_cu->imported_symtabs)
+ recursively_compute_inclusions (&result_symtabs, all_children.get (),
+ all_type_symtabs.get (), ptr,
+ per_objfile, cust);
/* Now we have a transitive closure of all the included symtabs. */
len = result_symtabs.size ();
load_full_comp_unit (per_cu, per_objfile, per_objfile->get_cu (per_cu),
false, cu->lang ());
- cu->per_cu->imported_symtabs_push (per_cu);
+ cu->per_cu->imported_symtabs.push_back (per_cu);
}
}
if (maybe_queue_comp_unit (NULL, sig_type, cu->per_objfile,
cu->lang ()))
load_full_type_unit (sig_type, cu->per_objfile);
- cu->per_cu->imported_symtabs_push (sig_type);
+ cu->per_cu->imported_symtabs.push_back (sig_type);
}
return 1;
http://sourceware.org/bugzilla/show_bug.cgi?id=15021. */
if (per_objfile->per_bfd->index_table != NULL
&& !per_objfile->per_bfd->index_table->version_check ())
- {
- (*ref_cu)->per_cu->imported_symtabs_push (sig_cu->per_cu);
- }
+ (*ref_cu)->per_cu->imported_symtabs.push_back (sig_cu->per_cu);
*ref_cu = sig_cu;
return die;
NOTE: This points into dwarf2_per_objfile->per_bfd->quick_file_names_table. */
struct quick_file_names *file_names = nullptr;
- /* The CUs we import using DW_TAG_imported_unit. This is filled in
- while reading psymtabs, used to compute the psymtab dependencies,
- and then cleared. Then it is filled in again while reading full
- symbols, and only deleted when the objfile is destroyed.
+ /* The CUs we import using DW_TAG_imported_unit.
This is also used to work around a difference between the way gold
generates .gdb_index version <=7 and the way gdb does. Arguably this
.gdb_index version <=7 this also records the TUs that the CU referred
to. Concurrently with this change gdb was modified to emit version 8
indices so we only pay a price for gold generated indices.
- http://sourceware.org/bugzilla/show_bug.cgi?id=15021.
-
- This currently needs to be a public member due to how
- dwarf2_per_cu_data is allocated and used. Ideally in future things
- could be refactored to make this private. Until then please try to
- avoid direct access to this member, and instead use the helper
- functions above. */
- std::vector <dwarf2_per_cu_data *> *imported_symtabs = nullptr;
-
- /* Return true of IMPORTED_SYMTABS is empty or not yet allocated. */
- bool imported_symtabs_empty () const
- {
- return (imported_symtabs == nullptr || imported_symtabs->empty ());
- }
-
- /* Push P to the back of IMPORTED_SYMTABS, allocated IMPORTED_SYMTABS
- first if required. */
- void imported_symtabs_push (dwarf2_per_cu_data *p)
- {
- if (imported_symtabs == nullptr)
- imported_symtabs = new std::vector <dwarf2_per_cu_data *>;
- imported_symtabs->push_back (p);
- }
-
- /* Return the size of IMPORTED_SYMTABS if it is allocated, otherwise
- return 0. */
- size_t imported_symtabs_size () const
- {
- if (imported_symtabs == nullptr)
- return 0;
- return imported_symtabs->size ();
- }
-
- /* Delete IMPORTED_SYMTABS and set the pointer back to nullptr. */
- void imported_symtabs_free ()
- {
- delete imported_symtabs;
- imported_symtabs = nullptr;
- }
+ http://sourceware.org/bugzilla/show_bug.cgi?id=15021. */
+ std::vector<dwarf2_per_cu_data *> imported_symtabs;
/* Get the header of this per_cu, reading it if necessary. */
const comp_unit_head *get_header () const;