Unify DW_TAG_typedef case in new_symbol
authorTom Tromey <tom@tromey.com>
Wed, 30 Aug 2023 00:38:25 +0000 (18:38 -0600)
committerTom Tromey <tom@tromey.com>
Thu, 31 Aug 2023 13:39:50 +0000 (07:39 -0600)
This patch merges the DW_TAG_typedef case in new_symbol with some
other type-related cases.  These all have identical code.

Reviewed-By: Guinevere Larsen <blarsen@redhat.com>
gdb/dwarf2/read.c

index b45afa12d0b67b074cc275724893163392e14328..94d98feb56b6197c7e3871b1062817c0ea6667fd 100644 (file)
@@ -19352,15 +19352,11 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
              }
          }
          break;
-       case DW_TAG_typedef:
-         sym->set_aclass_index (LOC_TYPEDEF);
-         sym->set_domain (VAR_DOMAIN);
-         list_to_add = cu->list_in_scope;
-         break;
        case DW_TAG_unspecified_type:
          if (cu->lang () == language_ada)
            break;
          /* FALLTHROUGH */
+       case DW_TAG_typedef:
        case DW_TAG_array_type:
        case DW_TAG_base_type:
        case DW_TAG_subrange_type: