aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-05-15 16:11:33 -0600
committerTom Tromey <tom@tromey.com>2020-05-15 16:11:34 -0600
commit8c14c3a3735d7de43e63710b2cd3a2e89cc4e243 (patch)
tree2fe8466fc509fbb3ddf291c3216c1a22aae7a129 /gdb/stabsread.c
parent5b4a1a8dbe6b15414c586d8fc6dbaecdcf4046f3 (diff)
downloadgdb-8c14c3a3735d7de43e63710b2cd3a2e89cc4e243.zip
gdb-8c14c3a3735d7de43e63710b2cd3a2e89cc4e243.tar.gz
gdb-8c14c3a3735d7de43e63710b2cd3a2e89cc4e243.tar.bz2
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 <tom@tromey.com> * 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.
Diffstat (limited to 'gdb/stabsread.c')
-rw-r--r--gdb/stabsread.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 77f105d..716b5f3 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -423,7 +423,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs,
/* On xcoff, if a global is defined and never referenced,
ld will remove it from the executable. There is then
a N_GSYM stab for it, but no regular (C_EXT) symbol. */
- sym = allocate_symbol (objfile);
+ sym = new (&objfile->objfile_obstack) symbol;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
sym->set_linkage_name
@@ -687,7 +687,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
e.g. ":t10=*2" or a nameless enum like " :T16=ered:0,green:1,blue:2,;" */
nameless = (p == string || ((string[0] == ' ') && (string[1] == ':')));
- current_symbol = sym = allocate_symbol (objfile);
+ current_symbol = sym = new (&objfile->objfile_obstack) symbol;
if (processing_gcc_compilation)
{
@@ -1307,7 +1307,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
if (synonym)
{
/* Create the STRUCT_DOMAIN clone. */
- struct symbol *struct_sym = allocate_symbol (objfile);
+ struct symbol *struct_sym = new (&objfile->objfile_obstack) symbol;
*struct_sym = *sym;
SYMBOL_ACLASS_INDEX (struct_sym) = LOC_TYPEDEF;
@@ -1349,7 +1349,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type,
if (synonym)
{
/* Clone the sym and then modify it. */
- struct symbol *typedef_sym = allocate_symbol (objfile);
+ struct symbol *typedef_sym = new (&objfile->objfile_obstack) symbol;
*typedef_sym = *sym;
SYMBOL_ACLASS_INDEX (typedef_sym) = LOC_TYPEDEF;
@@ -3632,7 +3632,7 @@ read_enum_type (const char **pp, struct type *type,
if (nbits != 0)
return error_type (pp, objfile);
- sym = allocate_symbol (objfile);
+ sym = new (&objfile->objfile_obstack) symbol;
sym->set_linkage_name (name);
sym->set_language (get_current_subfile ()->language,
&objfile->objfile_obstack);
@@ -4299,7 +4299,7 @@ common_block_end (struct objfile *objfile)
return;
}
- sym = allocate_symbol (objfile);
+ sym = new (&objfile->objfile_obstack) symbol;
/* Note: common_block_name already saved on objfile_obstack. */
sym->set_linkage_name (common_block_name);
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;