]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't check dwarf2_name in process_enumeration_scope
authorTom Tromey <tromey@adacore.com>
Mon, 26 Aug 2024 18:12:57 +0000 (12:12 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 28 Aug 2024 20:14:43 +0000 (14:14 -0600)
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 <keiths@redhat.com>
gdb/dwarf2/read.c

index 6ef47370e9675c8c6e8f8b767c54fa18aff1067b..6c503c6294101cd57708983584e7cc07c52689c8 100644 (file)
@@ -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;
        }