]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Small cleanup in DWARF reader
authorTom Tromey <tom@tromey.com>
Thu, 30 Mar 2023 16:25:40 +0000 (10:25 -0600)
committerTom Tromey <tom@tromey.com>
Sun, 28 Jan 2024 17:58:15 +0000 (10:58 -0700)
I noticed a couple of spots in dwarf/read.c:new_symbol that call
add_symbol_to_list.  However, this function is generally written to
set list_to_add, and then have a single call to add_symbol_to_list at
the end.  This patch cleans up this discrepancy.

Note that new_symbol is overlong and should probably be split up.

gdb/dwarf2/read.c

index 55a17358e660bae673732beac8323700a63afe8c..4ac8f346cc90f0324e95cced93f6f6682f271e5b 100644 (file)
@@ -18870,7 +18870,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
            sym->set_aclass_index (LOC_OPTIMIZED_OUT);
          sym->set_type (builtin_type (objfile)->builtin_core_addr);
          sym->set_domain (LABEL_DOMAIN);
-         add_symbol_to_list (sym, cu->list_in_scope);
+         list_to_add = cu->list_in_scope;
          break;
        case DW_TAG_entry_point:
          /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by
@@ -19209,7 +19209,7 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
        case DW_TAG_common_block:
          sym->set_aclass_index (LOC_COMMON_BLOCK);
          sym->set_domain (COMMON_BLOCK_DOMAIN);
-         add_symbol_to_list (sym, cu->list_in_scope);
+         list_to_add = cu->list_in_scope;
          break;
        default:
          /* Not a tag we recognize.  Hopefully we aren't processing