diff options
author | Tom Tromey <tom@tromey.com> | 2020-05-15 16:11:33 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2020-05-15 16:11:34 -0600 |
commit | 8c14c3a3735d7de43e63710b2cd3a2e89cc4e243 (patch) | |
tree | 2fe8466fc509fbb3ddf291c3216c1a22aae7a129 /gdb/xcoffread.c | |
parent | 5b4a1a8dbe6b15414c586d8fc6dbaecdcf4046f3 (diff) | |
download | gdb-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/xcoffread.c')
-rw-r--r-- | gdb/xcoffread.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 2c19dc8..93bdb9b 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -1521,11 +1521,6 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst) } } -#define SYMBOL_DUP(SYMBOL1, SYMBOL2) \ - (SYMBOL2) = new (&objfile->objfile_obstack) symbol (); \ - *(SYMBOL2) = *(SYMBOL1); - - #define SYMNAME_ALLOC(NAME, ALLOCED) \ ((ALLOCED) ? (NAME) : obstack_strdup (&objfile->objfile_obstack, \ (NAME))) @@ -1561,8 +1556,6 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile) if (name[0] == '.') ++name; - initialize_objfile_symbol (sym); - /* default assumptions */ SET_SYMBOL_VALUE_ADDRESS (sym, cs->c_value + off); SYMBOL_DOMAIN (sym) = VAR_DOMAIN; @@ -1578,7 +1571,7 @@ process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile) SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol; SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK; - SYMBOL_DUP (sym, sym2); + sym2 = new (&objfile->objfile_obstack) symbol (*sym); if (cs->c_sclass == C_EXT || C_WEAKEXT) add_symbol_to_list (sym2, get_global_symbols ()); |