From 8c14c3a3735d7de43e63710b2cd3a2e89cc4e243 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 15 May 2020 16:11:33 -0600 Subject: Remove allocate_symbol et al This removes allocate_symbol, allocate_template_symbol, and initialize_objfile_symbol in favor of changing the default values for symbol members, and updating the one per-arch caller. gdb/ChangeLog 2020-05-15 Tom Tromey * language.c (language_alloc_type_symbol): Set SYMBOL_SECTION. * symtab.c (initialize_objfile_symbol): Remove. (allocate_symbol): Remove. (allocate_template_symbol): Remove. * dwarf2/read.c (fixup_go_packaging): Use "new". (new_symbol): Use "new". (read_variable): Don't call initialize_objfile_symbol. Use "new". (read_func_scope): Use "new". * xcoffread.c (process_xcoff_symbol): Don't call initialize_objfile_symbol. (SYMBOL_DUP): Remove. * coffread.c (process_coff_symbol, coff_read_enum_type): Use "new". * symtab.h (allocate_symbol, initialize_objfile_symbol) (allocate_template_symbol): Don't declare. (struct symbol): Add copy constructor. Change defaults. * jit.c (finalize_symtab): Use "new". * ctfread.c (ctf_add_enum_member_cb, new_symbol, ctf_add_var_cb): Use "new". * stabsread.c (patch_block_stabs, define_symbol, read_enum_type) (common_block_end): Use "new". * mdebugread.c (parse_symbol): Use "new". (new_symbol): Likewise. --- gdb/coffread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/coffread.c') diff --git a/gdb/coffread.c b/gdb/coffread.c index d320332..7e3cb4a 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1556,7 +1556,7 @@ process_coff_symbol (struct coff_symbol *cs, union internal_auxent *aux, struct objfile *objfile) { - struct symbol *sym = allocate_symbol (objfile); + struct symbol *sym = new (&objfile->objfile_obstack) symbol; char *name; name = cs->c_name; @@ -2095,7 +2095,7 @@ coff_read_enum_type (int index, int length, int lastsym, switch (ms->c_sclass) { case C_MOE: - sym = allocate_symbol (objfile); + sym = new (&objfile->objfile_obstack) symbol; name = obstack_strdup (&objfile->objfile_obstack, name); sym->set_linkage_name (name); -- cgit v1.1