From: Tom Tromey Date: Mon, 26 Aug 2024 18:12:57 +0000 (-0600) Subject: Don't check dwarf2_name in process_enumeration_scope X-Git-Tag: gdb-16-branchpoint~1045 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a06416ebf9087b0cd20e54c2da58f7b57c6e6a8;p=thirdparty%2Fbinutils-gdb.git Don't check dwarf2_name in process_enumeration_scope 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. Reviewed-by: Keith Seitz --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 6ef47370e96..6c503c62941 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -13286,7 +13286,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) @@ -13296,11 +13295,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; }