aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/read.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-09-17 11:47:50 -0600
committerTom Tromey <tom@tromey.com>2020-09-17 11:58:56 -0600
commit280a9412e483c0e4d253a338477a602cffba058c (patch)
treeac8c39ac0f0b112b0268d503ab506c35f93c324f /gdb/dwarf2/read.c
parent6108fd1823f9cf036bbbe528ffcdf2fee489b40a (diff)
downloadgdb-280a9412e483c0e4d253a338477a602cffba058c.zip
gdb-280a9412e483c0e4d253a338477a602cffba058c.tar.gz
gdb-280a9412e483c0e4d253a338477a602cffba058c.tar.bz2
Use htab_up in dwarf2/read.c
This changes dwarf2/read.c to use htab_up rather than explicit calls to htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * dwarf2/read.c (compute_compunit_symtab_includes): Use htab_up.
Diffstat (limited to 'gdb/dwarf2/read.c')
-rw-r--r--gdb/dwarf2/read.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 33292b6..8cd1ace 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -9857,23 +9857,24 @@ compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
{
int len;
std::vector<compunit_symtab *> result_symtabs;
- htab_t all_children, all_type_symtabs;
compunit_symtab *cust = per_objfile->get_symtab (per_cu);
/* If we don't have a symtab, we can just skip this case. */
if (cust == NULL)
return;
- all_children = htab_create_alloc (1, htab_hash_pointer, htab_eq_pointer,
- NULL, xcalloc, xfree);
- all_type_symtabs = htab_create_alloc (1, htab_hash_pointer, htab_eq_pointer,
- NULL, xcalloc, xfree);
+ htab_up all_children (htab_create_alloc (1, htab_hash_pointer,
+ htab_eq_pointer,
+ NULL, xcalloc, xfree));
+ htab_up all_type_symtabs (htab_create_alloc (1, htab_hash_pointer,
+ htab_eq_pointer,
+ NULL, xcalloc, xfree));
for (dwarf2_per_cu_data *ptr : *per_cu->imported_symtabs)
{
- recursively_compute_inclusions (&result_symtabs, all_children,
- all_type_symtabs, ptr, per_objfile,
- cust);
+ 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. */
@@ -9884,9 +9885,6 @@ compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
memcpy (cust->includes, result_symtabs.data (),
len * sizeof (compunit_symtab *));
cust->includes[len] = NULL;
-
- htab_delete (all_children);
- htab_delete (all_type_symtabs);
}
}