Don't check dwarf2_name in process_enumeration_scope
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
Commit Message
I noticed that process_enumeration_scope checks the result of
dwarf2_name. However, this isn't needed, because new_symbol does the
same check. This patch removes the unnecessary code.
---
gdb/dwarf2/read.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
Comments
On 8/26/24 12:23 PM, Tom Tromey wrote:
> I noticed that process_enumeration_scope checks the result of
> dwarf2_name. However, this isn't needed, because new_symbol does the
> same check. This patch removes the unnecessary code.
Yes, indeed it does! Good catch.
Reviewed-by: Keith Seitz <keiths@redhat.com>
Keith
@@ -13262,7 +13262,6 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
if (die->child != NULL)
{
struct die_info *child_die;
- const char *name;
child_die = die->child;
while (child_die && child_die->tag)
@@ -13272,11 +13271,7 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu)
process_die (child_die, cu);
}
else
- {
- name = dwarf2_name (child_die, cu);
- if (name)
- new_symbol (child_die, this_type, cu);
- }
+ new_symbol (child_die, this_type, cu);
child_die = child_die->sibling;
}