From df86565b31bf12aab6fdceade49169bc6f378b13 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 21 Sep 2022 11:05:21 -0400 Subject: gdb: remove TYPE_LENGTH Remove the macro, replace all uses with calls to type::length. Change-Id: Ib9bdc954576860b21190886534c99103d6a47afb --- gdb/gdbtypes.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gdb/gdbtypes.h') diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 6d12a48..94d4b66 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1045,6 +1045,10 @@ struct type this->main_type->name = name; } + /* Note that if thistype is a TYPEDEF type, you have to call check_typedef. + But check_typedef does set the TYPE_LENGTH of the TYPEDEF type, + so you only have to call check_typedef once. Since allocate_value + calls check_typedef, VALUE_TYPE (X)->length () is safe. */ ULONGEST length () const { return this->m_length; @@ -2111,11 +2115,6 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type #define TYPE_RVALUE_REFERENCE_TYPE(thistype) (thistype)->rvalue_reference_type #define TYPE_CHAIN(thistype) (thistype)->chain -/* * Note that if thistype is a TYPEDEF type, you have to call check_typedef. - But check_typedef does set the TYPE_LENGTH of the TYPEDEF type, - so you only have to call check_typedef once. Since allocate_value - calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */ -#define TYPE_LENGTH(thistype) ((thistype)->length ()) /* * Return the alignment of the type in target addressable memory units, or 0 if no alignment was specified. */ -- cgit v1.1