Remove language check from dwarf2_compute_name

dwarf2_compute_name has a redundant check of the CU's language -- this
is also checked in dwarf2_canonicalize_name.  Removing this slightly
simplifies a future patch.

Reviewed-by: Andrew Burgess <aburgess@redhat.com>
This commit is contained in:
Tom Tromey
2022-11-04 14:08:13 -06:00
parent 00a5867df7
commit 5f0a4fb85e

View File

@ -8927,7 +8927,6 @@ dwarf2_compute_name (const char *name,
if (die_needs_namespace (die, cu)) if (die_needs_namespace (die, cu))
{ {
const char *prefix; const char *prefix;
const char *canonical_name = NULL;
string_file buf; string_file buf;
@ -9093,10 +9092,9 @@ dwarf2_compute_name (const char *name,
const std::string &intermediate_name = buf.string (); const std::string &intermediate_name = buf.string ();
if (lang == language_cplus) const char *canonical_name
canonical_name = dwarf2_canonicalize_name (intermediate_name.c_str (), cu,
= dwarf2_canonicalize_name (intermediate_name.c_str (), cu, objfile);
objfile);
/* If we only computed INTERMEDIATE_NAME, or if /* If we only computed INTERMEDIATE_NAME, or if
INTERMEDIATE_NAME is already canonical, then we need to INTERMEDIATE_NAME is already canonical, then we need to