From: Tom Tromey Date: Fri, 24 Apr 2020 21:35:01 +0000 (-0600) Subject: Remove symbol_get_demangled_name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7151c1af38e250fa4d024fa53f1cd5b3fc199314;p=binutils-gdb.git Remove symbol_get_demangled_name Now that symbol_get_demangled_name is only used by general_symbol_info methods, and because these methods already check the symbol's language to decide what to return, symbol_get_demangled_name is no longer needed. This patch removes it. gdb/ChangeLog 2020-04-24 Tom Tromey * symtab.h (symbol_get_demangled_name): Don't declare. * symtab.c (symbol_get_demangled_name): Remove. (general_symbol_info::natural_name) (general_symbol_info::demangled_name): Update. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e1c64ab7706..ccc0baafb1e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2020-04-24 Tom Tromey + + * symtab.h (symbol_get_demangled_name): Don't declare. + * symtab.c (symbol_get_demangled_name): Remove. + (general_symbol_info::natural_name) + (general_symbol_info::demangled_name): Update. + 2020-04-24 Tom Tromey PR rust/25025: diff --git a/gdb/symtab.c b/gdb/symtab.c index 7dd41fb4f32..652384cd469 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -690,21 +690,6 @@ general_symbol_info::set_demangled_name (const char *name, language_specific.demangled_name = name; } -/* Return the demangled name of GSYMBOL. */ - -const char * -symbol_get_demangled_name (const struct general_symbol_info *gsymbol) -{ - if (gsymbol->language () == language_ada) - { - if (!gsymbol->ada_mangled) - return NULL; - /* Fall through. */ - } - - return gsymbol->language_specific.demangled_name; -} - /* Initialize the language dependent portion of a symbol depending upon the language for the symbol. */ @@ -976,8 +961,8 @@ general_symbol_info::natural_name () const case language_objc: case language_fortran: case language_rust: - if (symbol_get_demangled_name (this) != NULL) - return symbol_get_demangled_name (this); + if (language_specific.demangled_name != nullptr) + return language_specific.demangled_name; break; case language_ada: return ada_decode_symbol (this); @@ -1002,7 +987,7 @@ general_symbol_info::demangled_name () const case language_objc: case language_fortran: case language_rust: - dem_name = symbol_get_demangled_name (this); + dem_name = language_specific.demangled_name; break; case language_ada: dem_name = ada_decode_symbol (this); diff --git a/gdb/symtab.h b/gdb/symtab.h index ee570f92285..5c5db0fabac 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -542,9 +542,6 @@ struct general_symbol_info short section; }; -extern const char *symbol_get_demangled_name - (const struct general_symbol_info *); - extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *); /* Return the address of SYM. The MAYBE_COPIED flag must be set on