+2020-02-08 Tom Tromey <tom@tromey.com>
+
+ * dwarf2/read.c (allocate_type_unit_groups_table): Return
+ htab_up. Don't allocate on obstack.
+ (get_type_unit_group, dwarf2_build_psymtabs_hard): Update.
+ * dwarf2/read.h (struct dwarf2_per_objfile) <type_unit_groups>:
+ Change type to htab_up.
+
2020-02-08 Tom Tromey <tom@tromey.com>
* dwarf2/read.h (struct dwarf2_per_objfile) <signatured_types>:
/* Allocate a hash table for type unit groups. */
-static htab_t
+static htab_up
allocate_type_unit_groups_table (struct objfile *objfile)
{
- return htab_create_alloc_ex (3,
- hash_type_unit_group,
- eq_type_unit_group,
- NULL,
- &objfile->objfile_obstack,
- hashtab_obstack_allocate,
- dummy_obstack_deallocate);
+ return htab_up (htab_create_alloc (3,
+ hash_type_unit_group,
+ eq_type_unit_group,
+ NULL, xcalloc, xfree));
}
/* Type units that don't have DW_AT_stmt_list are grouped into their own
type_unit_group_for_lookup.hash.dwo_unit = cu->dwo_unit;
type_unit_group_for_lookup.hash.line_sect_off = (sect_offset) line_offset;
- slot = htab_find_slot (dwarf2_per_objfile->type_unit_groups,
+ slot = htab_find_slot (dwarf2_per_objfile->type_unit_groups.get (),
&type_unit_group_for_lookup, INSERT);
if (*slot != NULL)
{
/* Now that all TUs have been processed we can fill in the dependencies. */
if (dwarf2_per_objfile->type_unit_groups != NULL)
{
- htab_traverse_noresize (dwarf2_per_objfile->type_unit_groups,
+ htab_traverse_noresize (dwarf2_per_objfile->type_unit_groups.get (),
build_type_psymtab_dependencies, dwarf2_per_objfile);
}
/* Table of struct type_unit_group objects.
The hash key is the DW_AT_stmt_list value. */
- htab_t type_unit_groups {};
+ htab_up type_unit_groups;
/* A table mapping .debug_types signatures to its signatured_type entry.
This is NULL if the .debug_types section hasn't been read in yet. */