[1/3] Remove language check from dwarf2_compute_name
Commit Message
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.
---
gdb/dwarf2/read.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
Comments
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
@@ -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