+2019-12-15 Christian Biesinger <cbiesinger@google.com>
+
+ * ada-exp.y (write_ambiguous_var): Update.
+ * coffread.c (process_coff_symbol): Update.
+ * ctfread.c (ctf_add_enum_member_cb): Update.
+ (new_symbol): Update.
+ * dwarf2read.c (fixup_go_packaging): Update.
+ (new_symbol): Update.
+ * language.c (language_alloc_type_symbol): Update.
+ * mdebugread.c (new_symbol): Update.
+ * minsyms.c (minimal_symbol_reader::record_full): Update.
+ * psymtab.c (add_psymbol_to_bcache): Update.
+ * stabsread.c (define_symbol): Update.
+ (read_enum_type): Update.
+ * symtab.c (symbol_set_language): Make this a member function...
+ (general_symbol_info::set_language): ... here.
+ * symtab.h (struct general_symbol_info) <set_language>: New function.
+ (SYMBOL_SET_LANGUAGE): Remove.
+ (symbol_set_language): Remove.
+
2019-12-15 Christian Biesinger <cbiesinger@google.com>
* ada-lang.c (ada_add_block_symbols): Update.
SYMBOL_DOMAIN (sym) = UNDEF_DOMAIN;
sym->set_linkage_name (obstack_strndup (&temp_parse_space, name, len));
- symbol_set_language (sym, language_ada, nullptr);
+ sym->set_language (language_ada, nullptr);
write_exp_elt_opcode (par_state, OP_VAR_VALUE);
write_exp_elt_block (par_state, block);
name = cs->c_name;
name = EXTERNAL_NAME (name, objfile->obfd);
- SYMBOL_SET_LANGUAGE (sym, get_current_subfile ()->language,
- &objfile->objfile_obstack);
+ sym->set_language (get_current_subfile ()->language,
+ &objfile->objfile_obstack);
SYMBOL_SET_NAMES (sym, name, true, objfile);
/* default assumptions */
struct symbol *sym = allocate_symbol (ccp->of);
OBJSTAT (ccp->of, n_syms++);
- SYMBOL_SET_LANGUAGE (sym, language_c, &ccp->of->objfile_obstack);
+ sym->set_language (language_c, &ccp->of->objfile_obstack);
SYMBOL_SET_NAMES (sym, name, false, ccp->of);
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
sym = allocate_symbol (objfile);
OBJSTAT (objfile, n_syms++);
- SYMBOL_SET_LANGUAGE (sym, language_c, &objfile->objfile_obstack);
+ sym->set_language (language_c, &objfile->objfile_obstack);
SYMBOL_SET_NAMES (sym, name.get (), true, objfile);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_ACLASS_INDEX (sym) = LOC_OPTIMIZED_OUT;
struct symbol *sym;
sym = allocate_symbol (objfile);
- SYMBOL_SET_LANGUAGE (sym, language_go, &objfile->objfile_obstack);
+ sym->set_language (language_go, &objfile->objfile_obstack);
SYMBOL_SET_NAMES (sym, saved_package_name, false, objfile);
/* This is not VAR_DOMAIN because we want a way to ensure a lookup of,
e.g., "main" finds the "main" module and not C's main(). */
OBJSTAT (objfile, n_syms++);
/* Cache this symbol's name and the name's demangled form (if any). */
- SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack);
+ sym->set_language (cu->language, &objfile->objfile_obstack);
linkagename = dwarf2_physname (name, die, cu);
SYMBOL_SET_NAMES (sym, linkagename, false, objfile);
symbol = new (gdbarch_obstack (gdbarch)) struct symbol ();
symbol->name = TYPE_NAME (type);
- symbol_set_language (symbol, lang, nullptr);
+ symbol->set_language (lang, nullptr);
symbol->owner.arch = gdbarch;
SYMBOL_OBJFILE_OWNED (symbol) = 0;
SYMBOL_TYPE (symbol) = type;
{
struct symbol *s = allocate_symbol (mdebugread_objfile);
- SYMBOL_SET_LANGUAGE (s, psymtab_language,
- &mdebugread_objfile->objfile_obstack);
+ s->set_language (psymtab_language, &mdebugread_objfile->objfile_obstack);
SYMBOL_SET_NAMES (s, name, true, mdebugread_objfile);
return s;
}
m_msym_bunch = newobj;
}
msymbol = &m_msym_bunch->contents[m_msym_bunch_index];
- symbol_set_language (msymbol, language_auto,
- &m_objfile->per_bfd->storage_obstack);
+ msymbol->set_language (language_auto,
+ &m_objfile->per_bfd->storage_obstack);
if (copy_name)
msymbol->name = obstack_strndup (&m_objfile->per_bfd->storage_obstack,
psymbol.ginfo.section = section;
psymbol.domain = domain;
psymbol.aclass = theclass;
- symbol_set_language (&psymbol.ginfo, language,
- objfile->partial_symtabs->obstack ());
+ psymbol.ginfo.set_language (language, objfile->partial_symtabs->obstack ());
symbol_set_names (&psymbol.ginfo, name, copy_name,
objfile->per_bfd);
SYMBOL_LINE (sym) = 0; /* unknown */
}
- SYMBOL_SET_LANGUAGE (sym, get_current_subfile ()->language,
- &objfile->objfile_obstack);
+ sym->set_language (get_current_subfile ()->language,
+ &objfile->objfile_obstack);
if (is_cplus_marker (string[0]))
{
sym = allocate_symbol (objfile);
sym->set_linkage_name (name);
- SYMBOL_SET_LANGUAGE (sym, get_current_subfile ()->language,
- &objfile->objfile_obstack);
+ sym->set_language (get_current_subfile ()->language,
+ &objfile->objfile_obstack);
SYMBOL_ACLASS_INDEX (sym) = LOC_CONST;
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_VALUE (sym) = n;
depending upon the language for the symbol. */
void
-symbol_set_language (struct general_symbol_info *gsymbol,
- enum language language,
- struct obstack *obstack)
+general_symbol_info::set_language (enum language language,
+ struct obstack *obstack)
{
- gsymbol->m_language = language;
+ m_language = language;
if (language == language_cplus
|| language == language_d
|| language == language_go
|| language == language_objc
|| language == language_fortran)
{
- symbol_set_demangled_name (gsymbol, NULL, obstack);
+ symbol_set_demangled_name (this, NULL, obstack);
}
else if (language == language_ada)
{
- gdb_assert (gsymbol->ada_mangled == 0);
- gsymbol->language_specific.obstack = obstack;
+ gdb_assert (ada_mangled == 0);
+ language_specific.obstack = obstack;
}
else
{
- memset (&gsymbol->language_specific, 0,
- sizeof (gsymbol->language_specific));
+ memset (&language_specific, 0, sizeof (language_specific));
}
}
enum language language () const
{ return m_language; }
+ /* Initializes the language dependent portion of a symbol
+ depending upon the language for the symbol. */
+ void set_language (enum language language, struct obstack *obstack);
+
/* Name of the symbol. This is a required field. Storage for the
name is allocated on the objfile_obstack for the associated
objfile. For languages like C++ that make a distinction between
? (&(((objfile)->sections)[(symbol)->section])) \
: NULL)
-/* Initializes the language dependent portion of a symbol
- depending upon the language for the symbol. */
-#define SYMBOL_SET_LANGUAGE(symbol,language,obstack) \
- (symbol_set_language ((symbol), (language), (obstack)))
-extern void symbol_set_language (struct general_symbol_info *symbol,
- enum language language,
- struct obstack *obstack);
-
/* Try to determine the demangled name for a symbol, based on the
language of that symbol. If the language is set to language_auto,
it will attempt to find any demangling algorithm that works and