From 5f0a4fb85ed3b5fb112ff884a98eb95c685658b0 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 4 Nov 2022 14:08:13 -0600 Subject: [PATCH] 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 --- gdb/dwarf2/read.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 -- 2.30.2