aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-11-04 14:08:13 -0600
committerTom Tromey <tromey@adacore.com>2022-12-01 11:16:41 -0700
commit5f0a4fb85ed3b5fb112ff884a98eb95c685658b0 (patch)
treebb86a5337fdb295354ca59a6fd9b1b0330937c16
parent00a5867df72983c3f8a11c9955c5032d6f601b70 (diff)
downloadgdb-5f0a4fb85ed3b5fb112ff884a98eb95c685658b0.zip
gdb-5f0a4fb85ed3b5fb112ff884a98eb95c685658b0.tar.gz
gdb-5f0a4fb85ed3b5fb112ff884a98eb95c685658b0.tar.bz2
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>
-rw-r--r--gdb/dwarf2/read.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index dd7fea4..aa13d42 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