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 641EE3857037 for ; Mon, 6 Jul 2020 13:38:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 641EE3857037 X-ASG-Debug-ID: 1594042725-0c856e4374aa520001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id x5Kjai1y2KMUN1Ya (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 06 Jul 2020 09:38:45 -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 4DA14441D64; Mon, 6 Jul 2020 09:38:45 -0400 (EDT) From: Simon Marchi 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 X-Barracuda-RBL-IP: 173.246.6.90 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 09/12] gdb: remove TYPE_ARRAY_{LOWER,UPPER}_BOUND_VALUE Date: Mon, 6 Jul 2020 09:38:30 -0400 X-ASG-Orig-Subj: [PATCH 09/12] gdb: remove TYPE_ARRAY_{LOWER, UPPER}_BOUND_VALUE Message-Id: <20200706133833.145408-10-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200706133833.145408-1-simon.marchi@polymtl.ca> References: <20200706133833.145408-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: 1594042725 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: 3274 X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 2.90 X-Barracuda-Spam-Status: No, SCORE=2.90 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests=TVD_SUBJ_WIPE_DEBT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.83013 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 2.90 TVD_SUBJ_WIPE_DEBT TVD_SUBJ_WIPE_DEBT X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_QUARANTINE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, TVD_SUBJ_WIPE_DEBT, 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: Mon, 06 Jul 2020 13:38:50 -0000 From: Simon Marchi Remove the macros, use the various equivalent getters instead. gdb/ChangeLog: * gdbtypes.h (TYPE_ARRAY_LOWER_BOUND_VALUE, TYPE_ARRAY_UPPER_BOUND_VALUE): Remove. Update all callers to use the equivalent accessor methods instead. Change-Id: I7f96d988f872170e7a2f58095832710e62b85cfd --- gdb/ada-lang.c | 4 ++-- gdb/f-valprint.c | 4 ++-- gdb/gdbtypes.h | 6 ------ gdb/p-typeprint.c | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 823d339912a9..2fc5fc1fdc2c 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -9492,8 +9492,8 @@ assign_aggregate (struct value *container, { lhs = ada_coerce_to_simple_array (lhs); lhs_type = check_typedef (value_type (lhs)); - low_index = TYPE_ARRAY_LOWER_BOUND_VALUE (lhs_type); - high_index = TYPE_ARRAY_UPPER_BOUND_VALUE (lhs_type); + low_index = lhs_type->index_type ()->bounds ()->low.const_val (); + high_index = lhs_type->index_type ()->bounds ()->high.const_val (); } else if (lhs_type->code () == TYPE_CODE_STRUCT) { diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 05f98bc35052..bda480376510 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -49,7 +49,7 @@ f77_get_lowerbound (struct type *type) if (type->index_type ()->bounds ()->low.kind () == PROP_UNDEFINED) error (_("Lower bound may not be '*' in F77")); - return TYPE_ARRAY_LOWER_BOUND_VALUE (type); + return type->index_type ()->bounds ()->low.const_val (); } LONGEST @@ -65,7 +65,7 @@ f77_get_upperbound (struct type *type) return f77_get_lowerbound (type); } - return TYPE_ARRAY_UPPER_BOUND_VALUE (type); + return type->index_type ()->bounds ()->high.const_val (); } /* Obtain F77 adjustable array dimensions. */ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 83432b6fc778..26db7935f265 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1628,12 +1628,6 @@ extern bool set_type_align (struct type *, ULONGEST); /* Accessors for struct range_bounds data attached to an array type's index type. */ -#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ - ((arraytype)->index_type ()->bounds ()->high.const_val ()) - -#define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \ - ((arraytype)->index_type ()->bounds ()->low.const_val ()) - #define TYPE_ARRAY_BIT_STRIDE(arraytype) \ (TYPE_BIT_STRIDE(((arraytype)->index_type ()))) diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index 5a32667603b7..d52358aa4bb4 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -276,8 +276,8 @@ pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream, if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0 && type->index_type ()->bounds ()->high.kind () != PROP_UNDEFINED) fprintf_filtered (stream, "[%s..%s] ", - plongest (TYPE_ARRAY_LOWER_BOUND_VALUE (type)), - plongest (TYPE_ARRAY_UPPER_BOUND_VALUE (type))); + plongest (type->index_type ()->bounds ()->low.const_val ()), + plongest (type->index_type ()->bounds ()->high.const_val ())); fprintf_filtered (stream, "of "); break; -- 2.27.0