Remove language_demangle

I noticed that language_demangle shadows the global
"current_language".  When I went to fix this, though, I then saw that
language_demangle is only called in two places, and has a comment
saying it should be removed.  This patch removes it.  Note that the
NULL check in language_demangle is not needed by either of the
existing callers.

Regression tested on x86-64 Fedora 36.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey 2023-03-29 13:51:13 -06:00
parent 6f214d0f39
commit 9497d69fc0
4 changed files with 2 additions and 22 deletions

View file

@ -540,21 +540,6 @@ skip_language_trampoline (frame_info_ptr frame, CORE_ADDR pc)
return 0;
}
/* Return demangled language symbol, or NULL.
FIXME: Options are only useful for certain languages and ignored
by others, so it would be better to remove them here and have a
more flexible demangler for the languages that need it.
FIXME: Sometimes the demangler is invoked when we don't know the
language, so we can't use this everywhere. */
gdb::unique_xmalloc_ptr<char>
language_demangle (const struct language_defn *current_language,
const char *mangled, int options)
{
if (current_language != NULL)
return current_language->demangle_symbol (mangled, options);
return NULL;
}
/* Return information about whether TYPE should be passed
(and returned) by reference at the language level. */