Remove symbol_get_demangled_name
authorTom Tromey <tom@tromey.com>
Fri, 24 Apr 2020 21:35:01 +0000 (15:35 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 24 Apr 2020 21:35:04 +0000 (15:35 -0600)
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  <tom@tromey.com>

* 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.

gdb/ChangeLog
gdb/symtab.c
gdb/symtab.h

index e1c64ab77068dad0b694cd7736a9ca08d6bbd1cb..ccc0baafb1e45eeb63e230e5cde41d4fe0a98db3 100644 (file)
@@ -1,3 +1,10 @@
+2020-04-24  Tom Tromey  <tom@tromey.com>
+
+       * 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  <tom@tromey.com>
 
        PR rust/25025:
index 7dd41fb4f32afe382afabe481af8382618e332f9..652384cd469e414a1e5b7adfb118234795e167bd 100644 (file)
@@ -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;
-}
-
 \f
 /* 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);
index ee570f922858fc05c1676838a03a52a3b63bf350..5c5db0fabacffaee52cf8dd7517c856c99f8a0cf 100644 (file)
@@ -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