+2020-04-24 Tom Tromey <tom@tromey.com>
+
+ * symtab.h (struct general_symbol_info) <set_demangled_name>: New
+ method.
+ (symbol_set_demangled_name): Don't declare.
+ * symtab.c (general_symbol_info::set_demangled_name): Rename from
+ symbol_set_demangled_name.
+ (general_symbol_info::set_language)
+ (general_symbol_info::compute_and_set_names): Update.
+ * minsyms.c (minimal_symbol_reader::install): Update.
+ * dwarf2/read.c (new_symbol): Update.
+
2020-04-24 Tom Tromey <tromey@adacore.com>
PR python/23662:
between gfortran, iFort etc. */
if (cu->language == language_fortran
&& symbol_get_demangled_name (sym) == NULL)
- symbol_set_demangled_name (sym,
- dwarf2_full_name (name, die, cu),
- NULL);
+ sym->set_demangled_name (dwarf2_full_name (name, die, cu), NULL);
/* Default assumptions.
Use the passed type or decode it from the die. */
/* This will be freed later, by compute_and_set_names. */
char *demangled_name
= symbol_find_demangled_name (msym, msym->linkage_name ());
- symbol_set_demangled_name
- (msym, demangled_name,
- &m_objfile->per_bfd->storage_obstack);
+ msym->set_demangled_name
+ (demangled_name, &m_objfile->per_bfd->storage_obstack);
msym->name_set = 1;
}
/* This mangled_name_hash computation has to be outside of
return (mangled_name);
}
-/* Set the demangled name of GSYMBOL to NAME. NAME must be already
- correctly allocated. */
+/* See symtab.h. */
void
-symbol_set_demangled_name (struct general_symbol_info *gsymbol,
- const char *name,
- struct obstack *obstack)
+general_symbol_info::set_demangled_name (const char *name,
+ struct obstack *obstack)
{
- if (gsymbol->language () == language_ada)
+ if (language () == language_ada)
{
if (name == NULL)
{
- gsymbol->ada_mangled = 0;
- gsymbol->language_specific.obstack = obstack;
+ ada_mangled = 0;
+ language_specific.obstack = obstack;
}
else
{
- gsymbol->ada_mangled = 1;
- gsymbol->language_specific.demangled_name = name;
+ ada_mangled = 1;
+ language_specific.demangled_name = name;
}
}
else
- gsymbol->language_specific.demangled_name = name;
+ language_specific.demangled_name = name;
}
/* Return the demangled name of GSYMBOL. */
|| language == language_objc
|| language == language_fortran)
{
- symbol_set_demangled_name (this, NULL, obstack);
+ set_demangled_name (NULL, obstack);
}
else if (language == language_ada)
{
m_name = obstack_strndup (&per_bfd->storage_obstack,
linkage_name.data (),
linkage_name.length ());
- symbol_set_demangled_name (this, NULL, &per_bfd->storage_obstack);
+ set_demangled_name (NULL, &per_bfd->storage_obstack);
return;
}
m_language = (*slot)->language;
m_name = (*slot)->mangled.data ();
- symbol_set_demangled_name (this, (*slot)->demangled.get (),
- &per_bfd->storage_obstack);
+ set_demangled_name ((*slot)->demangled.get (), &per_bfd->storage_obstack);
}
/* See symtab.h. */
void set_linkage_name (const char *linkage_name)
{ m_name = linkage_name; }
+ /* Set the demangled name of this symbol to NAME. NAME must be
+ already correctly allocated. If the symbol's language is Ada,
+ then the name is ignored and the obstack is set. */
+ void set_demangled_name (const char *name, struct obstack *obstack);
+
enum language language () const
{ return m_language; }
short section;
};
-extern void symbol_set_demangled_name (struct general_symbol_info *,
- const char *,
- struct obstack *);
-
extern const char *symbol_get_demangled_name
(const struct general_symbol_info *);