summaryrefslogtreecommitdiff
path: root/gdb/symtab.h
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/symtab.h
parent5b4a1a8dbe6b15414c586d8fc6dbaecdcf4046f3 (diff)
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/symtab.h')
-rw-r--r--gdb/symtab.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 764c567a90..aaf42a576a 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1107,7 +1107,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
/* Class-initialization of bitfields is only allowed in C++20. */
: domain (UNDEF_DOMAIN),
aclass_index (0),
- is_objfile_owned (0),
+ is_objfile_owned (1),
is_argument (0),
is_inlined (0),
maybe_copied (0),
@@ -1120,12 +1120,14 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
language_specific.obstack = nullptr;
m_language = language_unknown;
ada_mangled = 0;
- section = 0;
+ section = -1;
/* GCC 4.8.5 (on CentOS 7) does not correctly compile class-
initialization of unions, so we initialize it manually here. */
owner.symtab = nullptr;
}
+ symbol (const symbol &) = default;
+
/* Data type of value */
struct type *type = nullptr;
@@ -2331,12 +2333,6 @@ const char *
demangle_for_lookup (const char *name, enum language lang,
demangle_result_storage &storage);
-struct symbol *allocate_symbol (struct objfile *);
-
-void initialize_objfile_symbol (struct symbol *);
-
-struct template_symbol *allocate_template_symbol (struct objfile *);
-
/* Test to see if the symbol of language SYMBOL_LANGUAGE specified by
SYMNAME (which is already demangled for C++ symbols) matches
SYM_TEXT in the first SYM_TEXT_LEN characters. If so, add it to