diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-14 13:46:38 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-14 13:46:38 -0400 |
commit | 7813437494ac39f3aef392d06ed5416e84fe386b (patch) | |
tree | 15290bf5b2bd9d23c59103a6a42b99adc0111d6d /gdb/i386-tdep.c | |
parent | 67607e24d0413828acdfa9bc38f6fbac40b860b9 (diff) | |
download | fsf-binutils-gdb-7813437494ac39f3aef392d06ed5416e84fe386b.zip fsf-binutils-gdb-7813437494ac39f3aef392d06ed5416e84fe386b.tar.gz fsf-binutils-gdb-7813437494ac39f3aef392d06ed5416e84fe386b.tar.bz2 |
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.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r-- | gdb/i386-tdep.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index fc63635..0f8d9aa 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2633,14 +2633,14 @@ static int i386_16_byte_align_p (struct type *type) { type = check_typedef (type); - if ((TYPE_CODE (type) == TYPE_CODE_DECFLOAT - || (TYPE_CODE (type) == TYPE_CODE_ARRAY && TYPE_VECTOR (type))) + if ((type->code () == TYPE_CODE_DECFLOAT + || (type->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type))) && TYPE_LENGTH (type) == 16) return 1; - if (TYPE_CODE (type) == TYPE_CODE_ARRAY) + if (type->code () == TYPE_CODE_ARRAY) return i386_16_byte_align_p (TYPE_TARGET_TYPE (type)); - if (TYPE_CODE (type) == TYPE_CODE_STRUCT - || TYPE_CODE (type) == TYPE_CODE_UNION) + if (type->code () == TYPE_CODE_STRUCT + || type->code () == TYPE_CODE_UNION) { int i; for (i = 0; i < TYPE_NFIELDS (type); i++) @@ -2811,7 +2811,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type, int len = TYPE_LENGTH (type); gdb_byte buf[I386_MAX_REGISTER_SIZE]; - if (TYPE_CODE (type) == TYPE_CODE_FLT) + if (type->code () == TYPE_CODE_FLT) { if (tdep->st0_regnum < 0) { @@ -2861,7 +2861,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); int len = TYPE_LENGTH (type); - if (TYPE_CODE (type) == TYPE_CODE_FLT) + if (type->code () == TYPE_CODE_FLT) { ULONGEST fstat; gdb_byte buf[I386_MAX_REGISTER_SIZE]; @@ -2938,7 +2938,7 @@ static int i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - enum type_code code = TYPE_CODE (type); + enum type_code code = type->code (); int len = TYPE_LENGTH (type); gdb_assert (code == TYPE_CODE_STRUCT @@ -2955,7 +2955,7 @@ i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type) if (code == TYPE_CODE_STRUCT && TYPE_NFIELDS (type) == 1) { type = check_typedef (TYPE_FIELD_TYPE (type, 0)); - if (TYPE_CODE (type) == TYPE_CODE_FLT) + if (type->code () == TYPE_CODE_FLT) return (len == 4 || len == 8 || len == 12); } @@ -2973,7 +2973,7 @@ i386_return_value (struct gdbarch *gdbarch, struct value *function, struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { - enum type_code code = TYPE_CODE (type); + enum type_code code = type->code (); if (((code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION @@ -8398,13 +8398,13 @@ i386_type_align (struct gdbarch *gdbarch, struct type *type) if (gdbarch_ptr_bit (gdbarch) == 32) { - if ((TYPE_CODE (type) == TYPE_CODE_INT - || TYPE_CODE (type) == TYPE_CODE_FLT) + if ((type->code () == TYPE_CODE_INT + || type->code () == TYPE_CODE_FLT) && TYPE_LENGTH (type) > 4) return 4; /* Handle x86's funny long double. */ - if (TYPE_CODE (type) == TYPE_CODE_FLT + if (type->code () == TYPE_CODE_FLT && gdbarch_long_double_bit (gdbarch) == TYPE_LENGTH (type) * 8) return 4; } |