]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/symtab] Simplify child_die loop in read_file_scope
authorTom de Vries <tdevries@suse.de>
Fri, 18 Jun 2021 12:29:42 +0000 (14:29 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 24 Jun 2021 15:43:12 +0000 (17:43 +0200)
gdb/dwarf2/read.c

index 07bc08fba1409b8d379a496a0904de4f963defe1..16103e617d2010ad745807b0106bf0c154a4eb97 100644 (file)
@@ -10531,15 +10531,10 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
   handle_DW_AT_stmt_list (die, cu, fnd.comp_dir, lowpc);
 
   /* Process all dies in compilation unit.  */
-  if (die->child != NULL)
-    {
-      child_die = die->child;
-      while (child_die && child_die->tag)
-       {
-         process_die (child_die, cu);
-         child_die = child_die->sibling;
-       }
-    }
+  for (child_die = die->child; child_die != nullptr && child_die->tag != 0;
+       child_die = child_die->sibling)
+    process_die (child_die, cu);
+
   per_objfile->sym_cu = nullptr;
 
   /* Decode macro information, if present.  Dwarf 2 macro information