From: Tom Tromey Date: Fri, 4 Nov 2022 20:08:13 +0000 (-0600) Subject: Remove language check from dwarf2_compute_name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5f0a4fb85ed3b5fb112ff884a98eb95c685658b0;p=binutils-gdb.git 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 --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index dd7fea40027..aa13d42ad77 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -8927,7 +8927,6 @@ dwarf2_compute_name (const char *name, if (die_needs_namespace (die, cu)) { const char *prefix; - const char *canonical_name = NULL; string_file buf; @@ -9093,10 +9092,9 @@ dwarf2_compute_name (const char *name, const std::string &intermediate_name = buf.string (); - if (lang == language_cplus) - canonical_name - = dwarf2_canonicalize_name (intermediate_name.c_str (), cu, - objfile); + const char *canonical_name + = dwarf2_canonicalize_name (intermediate_name.c_str (), cu, + objfile); /* If we only computed INTERMEDIATE_NAME, or if INTERMEDIATE_NAME is already canonical, then we need to