From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org>,
gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: Re: [PATCH 1/3] Remove language check from dwarf2_compute_name
Date: Thu, 01 Dec 2022 15:16:41 +0000 [thread overview]
Message-ID: <87h6yf17dy.fsf@redhat.com> (raw)
In-Reply-To: <20221107162356.3175221-2-tromey@adacore.com>
Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:
> 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.
LGTM.
Thanks,
Andrew
> ---
> 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 60e120a9d76..978dd4d0bb9 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -8918,7 +8918,6 @@ dwarf2_compute_name (const char *name,
> if (die_needs_namespace (die, cu))
> {
> const char *prefix;
> - const char *canonical_name = NULL;
>
> string_file buf;
>
> @@ -9084,10 +9083,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.34.3
next prev parent reply other threads:[~2022-12-01 15:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 16:23 [PATCH 0/3] Fix over-eager CU expansion with new DWARF reader Tom Tromey
2022-11-07 16:23 ` [PATCH 1/3] Remove language check from dwarf2_compute_name Tom Tromey
2022-12-01 15:16 ` Andrew Burgess [this message]
2022-11-07 16:23 ` [PATCH 2/3] Refactor cooked_index::do_finalize Tom Tromey
2022-12-01 15:34 ` Andrew Burgess
2022-11-07 16:23 ` [PATCH 3/3] Add name canonicalization for C Tom Tromey
2022-12-01 16:06 ` Simon Marchi
2022-12-01 16:29 ` Andrew Burgess
2022-12-01 17:56 ` Tom Tromey
2022-12-01 18:16 ` Tom Tromey
2022-12-01 23:23 ` Andrew Burgess
2022-12-02 14:39 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6yf17dy.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).