From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id 4F4D6396E07C for ; Thu, 30 Apr 2020 18:17:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4F4D6396E07C X-ASG-Debug-ID: 1588270675-0c856e18f311b5a80001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id fjvZEGFqKT2XilNE (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 30 Apr 2020 14:17:55 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id EF7B1441D64; Thu, 30 Apr 2020 14:17:54 -0400 (EDT) From: Simon Marchi X-Barracuda-Effective-Source-IP: 192-222-181-218.qc.cable.ebox.net[192.222.181.218] X-Barracuda-Apparent-Source-IP: 192.222.181.218 X-Barracuda-RBL-IP: 192.222.181.218 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 4/4] gdb: remove TYPE_DYN_PROP_LIST macro Date: Thu, 30 Apr 2020 14:17:53 -0400 X-ASG-Orig-Subj: [PATCH 4/4] gdb: remove TYPE_DYN_PROP_LIST macro Message-Id: <20200430181753.1093-5-simon.marchi@efficios.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200430181753.1093-1-simon.marchi@efficios.com> References: <20200430181753.1093-1-simon.marchi@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1588270675 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 3683 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.81535 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-38.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2020 18:17:58 -0000 Remove this macro, which abstracts how to obtain the dyn_prop_list of a given type. We could replace it with a method on `struct type`, but I don't think it's needed, as the only code that accesses the dynamic prop list directly is internal gdbtypes.c code (that can be seen as code internal to `struct type`). So it can just refer to the field directly. gdb/ChangeLog: * gdbtypes.h (TYPE_DYN_PROP_LIST): Remove. Update all users access thistype->main_type->dyn_prop_list directly. --- gdb/gdbtypes.c | 22 +++++++++++----------- gdb/gdbtypes.h | 2 -- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 566c6c4f063..a7109338415 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -2636,7 +2636,7 @@ resolve_dynamic_type (struct type *type, dynamic_prop * type::get_dyn_prop (dynamic_prop_node_kind prop_kind) const { - dynamic_prop_list *node = TYPE_DYN_PROP_LIST (this); + dynamic_prop_list *node = this->main_type->dyn_prop_list; while (node != NULL) { @@ -2660,9 +2660,9 @@ type::add_dyn_prop (dynamic_prop_node_kind prop_kind, dynamic_prop prop) struct dynamic_prop_list); temp->prop_kind = prop_kind; temp->prop = prop; - temp->next = TYPE_DYN_PROP_LIST (this); + temp->next = this->main_type->dyn_prop_list; - TYPE_DYN_PROP_LIST (this) = temp; + this->main_type->dyn_prop_list = temp; } /* See gdbtypes.h. */ @@ -2672,7 +2672,7 @@ type::remove_dyn_prop (dynamic_prop_node_kind kind) { struct dynamic_prop_list *prev_node, *curr_node; - curr_node = TYPE_DYN_PROP_LIST (this); + curr_node = this->main_type->dyn_prop_list; prev_node = NULL; while (NULL != curr_node) @@ -2684,7 +2684,7 @@ type::remove_dyn_prop (dynamic_prop_node_kind kind) if we are on top of it. Nevertheless, everything is released when the complete objstack is freed. */ if (NULL == prev_node) - TYPE_DYN_PROP_LIST (this) = curr_node->next; + this->main_type->dyn_prop_list = curr_node->next; else prev_node->next = curr_node->next; @@ -5347,10 +5347,10 @@ copy_type_recursive (struct objfile *objfile, *TYPE_RANGE_DATA (new_type) = *TYPE_RANGE_DATA (type); } - if (TYPE_DYN_PROP_LIST (type) != NULL) - TYPE_DYN_PROP_LIST (new_type) + if (type->main_type->dyn_prop_list != NULL) + new_type->main_type->dyn_prop_list = copy_dynamic_prop_list (&objfile->objfile_obstack, - TYPE_DYN_PROP_LIST (type)); + type->main_type->dyn_prop_list); /* Copy pointers to other types. */ @@ -5415,10 +5415,10 @@ copy_type (const struct type *type) TYPE_LENGTH (new_type) = TYPE_LENGTH (type); memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type), sizeof (struct main_type)); - if (TYPE_DYN_PROP_LIST (type) != NULL) - TYPE_DYN_PROP_LIST (new_type) + if (type->main_type->dyn_prop_list != NULL) + new_type->main_type->dyn_prop_list = copy_dynamic_prop_list (&TYPE_OBJFILE (type) -> objfile_obstack, - TYPE_DYN_PROP_LIST (type)); + type->main_type->dyn_prop_list); return new_type; } diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 50edcca841c..513ee5572d7 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1475,8 +1475,6 @@ extern bool set_type_align (struct type *, ULONGEST); ((thistype)->get_dyn_prop (DYN_PROP_ASSOCIATED)) /* Attribute accessors for dynamic properties. */ -#define TYPE_DYN_PROP_LIST(thistype) \ - TYPE_MAIN_TYPE(thistype)->dyn_prop_list #define TYPE_DYN_PROP_BATON(dynprop) \ dynprop->data.baton #define TYPE_DYN_PROP_ADDR(dynprop) \ -- 2.26.2