diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2020-05-23 17:39:54 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2020-05-23 17:39:54 -0400 |
commit | ceacbf6edf2c72aaa16280205a9bfc8513e9ed27 (patch) | |
tree | 0e801f13f8c4c59f584af1e1cd5c9e49b225c3ab /gdb/gdbtypes.h | |
parent | 26f16254544873f4d7450f6fbbc8f34bf3d2e359 (diff) | |
download | binutils-gdb-ceacbf6edf2c72aaa16280205a9bfc8513e9ed27.tar.gz |
gdb: remove TYPE_FIELD macro
Replace all uses of it by type::field.
Note that since type::field returns a reference to the field, some spots
are used to assign the whole field structure. See ctfread.c, function
attach_fields_to_type, for example. This is the same as was happening
with the macro, so I don't think it's a problem, but if anybody sees a
really nicer way to do this, now could be a good time to implement it.
gdb/ChangeLog:
* gdbtypes.h (TYPE_FIELD): Remove. Replace all uses with
type::field.
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r-- | gdb/gdbtypes.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index f91adbc6cc2..60cbcd1003f 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1613,18 +1613,17 @@ extern void set_type_vptr_basetype (struct type *, struct type *); #define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial) #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize) -#define TYPE_FIELD(thistype, n) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields[n] -#define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n)) -#define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n)) -#define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) -#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) -#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) -#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) -#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) -#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) -#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) -#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n)) -#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0) +#define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE((thistype)->field (n)) +#define TYPE_FIELD_NAME(thistype, n) FIELD_NAME((thistype)->field (n)) +#define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND ((thistype)->field (n)) +#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS ((thistype)->field (n)) +#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL ((thistype)->field (n)) +#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME ((thistype)->field (n)) +#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR ((thistype)->field (n)) +#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK ((thistype)->field (n)) +#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL((thistype)->field (n)) +#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE((thistype)->field (n)) +#define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE((thistype)->field (n))!=0) #define TYPE_FIELD_PRIVATE_BITS(thistype) \ TYPE_CPLUS_SPECIFIC(thistype)->private_field_bits |