public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Remove language check from dwarf2_compute_name
@ 2022-12-01 18:18 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-12-01 18:18 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5f0a4fb85ed3b5fb112ff884a98eb95c685658b0

commit 5f0a4fb85ed3b5fb112ff884a98eb95c685658b0
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri Nov 4 14:08:13 2022 -0600

    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>

Diff:
---
 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-01 18:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 18:18 [binutils-gdb] Remove language check from dwarf2_compute_name Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).