From patchwork Sat Jan 6 00:26:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 25241 Received: (qmail 5337 invoked by alias); 6 Jan 2018 00:26:29 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5141 invoked by uid 89); 6 Jan 2018 00:26:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway36.websitewelcome.com Received: from gateway36.websitewelcome.com (HELO gateway36.websitewelcome.com) (192.185.185.36) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 06 Jan 2018 00:26:26 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway36.websitewelcome.com (Postfix) with ESMTP id 5A2CE403D8651 for ; Fri, 5 Jan 2018 18:26:25 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id XcJdegLSScGlpXcJdeou8h; Fri, 05 Jan 2018 18:26:25 -0600 Received: from 71-218-90-63.hlrn.qwest.net ([71.218.90.63]:39986 helo=pokyo.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eXcJd-0035k1-5U; Fri, 05 Jan 2018 18:26:25 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 5/6] Remove objfile argument from add_dyn_prop Date: Fri, 5 Jan 2018 17:26:20 -0700 Message-Id: <20180106002621.21099-6-tom@tromey.com> In-Reply-To: <20180106002621.21099-1-tom@tromey.com> References: <20180106002621.21099-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1eXcJd-0035k1-5U X-Source-Sender: 71-218-90-63.hlrn.qwest.net (pokyo.Home) [71.218.90.63]:39986 X-Source-Auth: tom+tromey.com X-Email-Count: 6 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes The objfile argument to add_dyn_prop is redundant, so this patch removes it. 2018-01-05 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. --- gdb/ChangeLog | 7 +++++++ gdb/dwarf2read.c | 6 +++--- gdb/gdbtypes.c | 7 +++---- gdb/gdbtypes.h | 5 ++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0c878d9aba..e9b6023047 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2018-01-05 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-05 Tom Tromey + * dwarf2read.c (delayed_method_info): Remove typedef. (dwarf2_cu::method_info): Now a std::vector. (add_to_method_list): Update. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 998c8479ea..3807251970 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -25116,7 +25116,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) { @@ -25131,7 +25131,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) { @@ -25144,7 +25144,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 7ba62df474..c438696217 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,13 @@ 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 5942b5ad48..712b16b698 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);