From 7813437494ac39f3aef392d06ed5416e84fe386b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 14 May 2020 13:46:38 -0400 Subject: gdb: remove TYPE_CODE macro Remove TYPE_CODE, changing all the call sites to use type::code directly. This is quite a big diff, but this was mostly done using sed and coccinelle. A few call sites were done by hand. gdb/ChangeLog: * gdbtypes.h (TYPE_CODE): Remove. Change all call sites to use type::code instead. --- gdb/gdbtypes.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gdb/gdbtypes.h') diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 9f4924e9404..a8cd44a75bf 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -335,7 +335,7 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags); /* * True if this type represents either an lvalue or lvalue reference type. */ #define TYPE_IS_REFERENCE(t) \ - (TYPE_CODE (t) == TYPE_CODE_REF || TYPE_CODE (t) == TYPE_CODE_RVALUE_REF) + ((t)->code () == TYPE_CODE_REF || (t)->code () == TYPE_CODE_RVALUE_REF) /* * True if this type is allocatable. */ #define TYPE_IS_ALLOCATABLE(t) \ @@ -1435,7 +1435,6 @@ extern unsigned type_align (struct type *); space in struct type. */ extern bool set_type_align (struct type *, ULONGEST); -#define TYPE_CODE(thistype) ((thistype)->code ()) #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields @@ -1681,8 +1680,8 @@ extern void set_type_vptr_basetype (struct type *, struct type *); TYPE_NESTED_TYPES_FIELD (thistype, n).is_private #define TYPE_IS_OPAQUE(thistype) \ - (((TYPE_CODE (thistype) == TYPE_CODE_STRUCT) \ - || (TYPE_CODE (thistype) == TYPE_CODE_UNION)) \ + ((((thistype)->code () == TYPE_CODE_STRUCT) \ + || ((thistype)->code () == TYPE_CODE_UNION)) \ && (TYPE_NFIELDS (thistype) == 0) \ && (!HAVE_CPLUS_STRUCT (thistype) \ || TYPE_NFN_FIELDS (thistype) == 0) \ -- cgit v1.2.1