+2019-03-15 Tom Tromey <tom@tromey.com>
+
+ * symtab.c (create_demangled_names_hash): Update.
+ (symbol_set_names): Update.
+ * objfiles.h (struct objfile_per_bfd_storage)
+ <demangled_names_hash>: Now an htab_up.
+ * objfiles.c (objfile_per_bfd_storage): Simplify.
+
2019-03-15 Tom Tromey <tom@tromey.com>
* objfiles.h (struct objfile_per_bfd_storage): Declare
objfile_per_bfd_storage::~objfile_per_bfd_storage ()
{
- if (demangled_names_hash)
- htab_delete (demangled_names_hash);
}
/* Create the per-BFD storage object for OBJFILE. If ABFD is not
name, and the second is the demangled name or just a zero byte
if the name doesn't demangle. */
- htab *demangled_names_hash = NULL;
+ htab_up demangled_names_hash;
/* The per-objfile information about the entry point, the scope (file/func)
containing the entry point, and the scope of the user's main() func. */
Choosing a much larger table size wastes memory, and saves only about
1% in symbol reading. */
- per_bfd->demangled_names_hash = htab_create_alloc
+ per_bfd->demangled_names_hash.reset (htab_create_alloc
(256, hash_demangled_name_entry, eq_demangled_name_entry,
- NULL, xcalloc, xfree);
+ NULL, xcalloc, xfree));
}
/* Try to determine the demangled name for a symbol, based on the
entry.mangled = linkage_name_copy;
slot = ((struct demangled_name_entry **)
- htab_find_slot (per_bfd->demangled_names_hash,
+ htab_find_slot (per_bfd->demangled_names_hash.get (),
&entry, INSERT));
/* If this name is not in the hash table, add it. */