From: Tom Tromey Date: Sat, 6 Jan 2018 00:26:20 +0000 (-0700) Subject: Remove objfile argument from add_dyn_prop X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=50a820477b5d48d4c2d28ca1c22ba6d93c9fd7cb;p=binutils-gdb.git Remove objfile argument from add_dyn_prop The objfile argument to add_dyn_prop is redundant, so this patch removes it. 2018-01-17 Tom Tromey * gdbtypes.h (add_dyn_prop): Remove objfile parameter. * gdbtypes.c (add_dyn_prop): Remove objfile parameter. (create_array_type_with_stride): Update. * dwarf2read.c (set_die_type): Update. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f01c63e0b93..871d03802f2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-01-17 Tom Tromey + + * gdbtypes.h (add_dyn_prop): Remove objfile parameter. + * gdbtypes.c (add_dyn_prop): Remove objfile parameter. + (create_array_type_with_stride): Update. + * dwarf2read.c (set_die_type): Update. + 2018-01-17 Tom Tromey * dwarf2read.c (delayed_method_info): Remove typedef. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9d27638879f..53c57ef1632 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -25276,7 +25276,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) if (attr_form_is_block (attr)) { if (attr_to_dynamic_prop (attr, die, cu, &prop)) - add_dyn_prop (DYN_PROP_ALLOCATED, prop, type, objfile); + add_dyn_prop (DYN_PROP_ALLOCATED, prop, type); } else if (attr != NULL) { @@ -25291,7 +25291,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) if (attr_form_is_block (attr)) { if (attr_to_dynamic_prop (attr, die, cu, &prop)) - add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type, objfile); + add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type); } else if (attr != NULL) { @@ -25304,7 +25304,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); if (attr_to_dynamic_prop (attr, die, cu, &prop)) - add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile); + add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type); if (dwarf2_per_objfile->die_type_hash == NULL) { diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 7ba62df474e..f6bbb90f797 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1166,8 +1166,7 @@ create_array_type_with_stride (struct type *result_type, (struct field *) TYPE_ZALLOC (result_type, sizeof (struct field)); TYPE_INDEX_TYPE (result_type) = range_type; if (byte_stride_prop != NULL) - add_dyn_prop (DYN_PROP_BYTE_STRIDE, *byte_stride_prop, result_type, - TYPE_OBJFILE (result_type)); + add_dyn_prop (DYN_PROP_BYTE_STRIDE, *byte_stride_prop, result_type); else if (bit_stride > 0) TYPE_FIELD_BITSIZE (result_type, 0) = bit_stride; @@ -2305,13 +2304,14 @@ get_dyn_prop (enum dynamic_prop_node_kind prop_kind, const struct type *type) void add_dyn_prop (enum dynamic_prop_node_kind prop_kind, struct dynamic_prop prop, - struct type *type, struct objfile *objfile) + struct type *type) { struct dynamic_prop_list *temp; gdb_assert (TYPE_OBJFILE_OWNED (type)); - temp = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop_list); + temp = XOBNEW (&TYPE_OBJFILE (type)->objfile_obstack, + struct dynamic_prop_list); temp->prop_kind = prop_kind; temp->prop = prop; temp->next = TYPE_DYN_PROP_LIST (type); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 5942b5ad48c..712b16b6989 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1841,11 +1841,10 @@ extern struct dynamic_prop *get_dyn_prop /* * Given a dynamic property PROP of a given KIND, add this dynamic property to the given TYPE. - This function assumes that TYPE is objfile-owned, and that OBJFILE - is the TYPE's objfile. */ + This function assumes that TYPE is objfile-owned. */ extern void add_dyn_prop (enum dynamic_prop_node_kind kind, struct dynamic_prop prop, - struct type *type, struct objfile *objfile); + struct type *type); extern void remove_dyn_prop (enum dynamic_prop_node_kind prop_kind, struct type *type);