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 B90CD3858D35 for ; Sat, 1 Aug 2020 23:59:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B90CD3858D35 X-ASG-Debug-ID: 1596326383-0c856e1810346cb0001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id uDZ1OX49r86fNUFZ (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 01 Aug 2020 19:59:44 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.localdomain (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) by smtp.ebox.ca (Postfix) with ESMTP id DCB7A441D65; Sat, 1 Aug 2020 19:59:43 -0400 (EDT) From: Simon Marchi X-Barracuda-RBL-IP: 173.246.6.90 X-Barracuda-Effective-Source-IP: 173-246-6-90.qc.cable.ebox.net[173.246.6.90] X-Barracuda-Apparent-Source-IP: 173.246.6.90 To: gdb-patches@sourceware.org Subject: [PATCH 2/3] gdb: remove TYPE_DYN_PROP_KIND Date: Sat, 1 Aug 2020 19:59:34 -0400 X-ASG-Orig-Subj: [PATCH 2/3] gdb: remove TYPE_DYN_PROP_KIND Message-Id: <20200801235935.1110640-3-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200801235935.1110640-1-simon.marchi@polymtl.ca> References: <20200801235935.1110640-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1596326384 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 2748 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.50 X-Barracuda-Spam-Status: No, SCORE=0.50 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.83628 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_QUARANTINE, 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: Sat, 01 Aug 2020 23:59:49 -0000 Replace uses with calling the dynamic_prop::kind method directly. gdb/ChangeLog: * gdbtypes.h (TYPE_DYN_PROP_KIND): Remove, replace uses with dynamic_prop::kind. Change-Id: I78a3e2890f0b3e3950e9a19ad657b976cbb9610b --- gdb/f-typeprint.c | 6 +++--- gdb/gdbtypes.c | 8 ++++---- gdb/gdbtypes.h | 2 -- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index 65ec93af9f41..c3a01673d2bc 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -196,11 +196,11 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, else if (type_not_allocated (type)) print_rank_only = true; else if ((TYPE_ASSOCIATED_PROP (type) - && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ASSOCIATED_PROP (type))) + && PROP_CONST != TYPE_ASSOCIATED_PROP (type)->kind ()) || (TYPE_ALLOCATED_PROP (type) - && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_ALLOCATED_PROP (type))) + && PROP_CONST != TYPE_ALLOCATED_PROP (type)->kind ()) || (TYPE_DATA_LOCATION (type) - && PROP_CONST != TYPE_DYN_PROP_KIND (TYPE_DATA_LOCATION (type)))) + && PROP_CONST != TYPE_DATA_LOCATION (type)->kind ())) { /* This case exist when we ptype a typename which has the dynamic properties but cannot be resolved as there is no object. */ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index e87648813ec5..4b1f40ab77dc 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -4133,8 +4133,8 @@ type_not_allocated (const struct type *type) { struct dynamic_prop *prop = TYPE_ALLOCATED_PROP (type); - return (prop && TYPE_DYN_PROP_KIND (prop) == PROP_CONST - && !TYPE_DYN_PROP_ADDR (prop)); + return (prop != nullptr && prop->kind () == PROP_CONST + && !TYPE_DYN_PROP_ADDR (prop)); } /* Associated status of type TYPE. Return zero if type TYPE is associated. @@ -4145,8 +4145,8 @@ type_not_associated (const struct type *type) { struct dynamic_prop *prop = TYPE_ASSOCIATED_PROP (type); - return (prop && TYPE_DYN_PROP_KIND (prop) == PROP_CONST - && !TYPE_DYN_PROP_ADDR (prop)); + return (prop != nullptr && prop->kind () == PROP_CONST + && !TYPE_DYN_PROP_ADDR (prop)); } /* rank_one_type helper for when PARM's type code is TYPE_CODE_PTR. */ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 9ea23718ffb5..de54a5ed73b6 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1638,8 +1638,6 @@ extern bool set_type_align (struct type *, ULONGEST); /* Attribute accessors for dynamic properties. */ #define TYPE_DYN_PROP_ADDR(dynprop) \ (dynprop->const_val ()) -#define TYPE_DYN_PROP_KIND(dynprop) \ - (dynprop->kind ()) /* C++ */ -- 2.28.0