diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-14 13:45:40 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-14 13:45:40 -0400 |
commit | 67607e24d0413828acdfa9bc38f6fbac40b860b9 (patch) | |
tree | 244fb4d92616ef31b9b22197d5a90df09e0147b2 /gdb/coffread.c | |
parent | 02eba61aa6cad683e96cf13f483adc04982c0c2b (diff) | |
download | fsf-binutils-gdb-67607e24d0413828acdfa9bc38f6fbac40b860b9.zip fsf-binutils-gdb-67607e24d0413828acdfa9bc38f6fbac40b860b9.tar.gz fsf-binutils-gdb-67607e24d0413828acdfa9bc38f6fbac40b860b9.tar.bz2 |
gdb: add type::code / type::set_code
Add the code and set_code methods on code, in order to remove the
TYPE_CODE macro. In this patch, the TYPE_CODE macro is changed to use
type::code, so all the call sites that are used to set the type code are
changed to use type::set_code. The next patch will remove TYPE_CODE
completely.
gdb/ChangeLog:
* gdbtypes.h (struct type) <code, set_code>: New methods.
(TYPE_CODE): Use type::code. Change all call sites used to set
the code to use type::set_code instead.
Diffstat (limited to 'gdb/coffread.c')
-rw-r--r-- | gdb/coffread.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index 7fbdcc4..4b2993f 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -1880,7 +1880,7 @@ decode_base_type (struct coff_symbol *cs, { /* Anonymous structure type. */ type = coff_alloc_type (cs->c_symnum); - TYPE_CODE (type) = TYPE_CODE_STRUCT; + type->set_code (TYPE_CODE_STRUCT); TYPE_NAME (type) = NULL; INIT_CPLUS_SPECIFIC (type); TYPE_LENGTH (type) = 0; @@ -1914,7 +1914,7 @@ decode_base_type (struct coff_symbol *cs, aux->x_sym.x_fcnary.x_fcn.x_endndx.l, objfile); } - TYPE_CODE (type) = TYPE_CODE_UNION; + type->set_code (TYPE_CODE_UNION); return type; case T_ENUM: @@ -1922,7 +1922,7 @@ decode_base_type (struct coff_symbol *cs, { /* Anonymous enum type. */ type = coff_alloc_type (cs->c_symnum); - TYPE_CODE (type) = TYPE_CODE_ENUM; + type->set_code (TYPE_CODE_ENUM); TYPE_NAME (type) = NULL; TYPE_LENGTH (type) = 0; TYPE_FIELDS (type) = 0; @@ -1990,7 +1990,7 @@ coff_read_struct_type (int index, int length, int lastsym, int done = 0; type = coff_alloc_type (index); - TYPE_CODE (type) = TYPE_CODE_STRUCT; + type->set_code (TYPE_CODE_STRUCT); INIT_CPLUS_SPECIFIC (type); TYPE_LENGTH (type) = length; @@ -2121,7 +2121,7 @@ coff_read_enum_type (int index, int length, int lastsym, TYPE_LENGTH (type) = length; else /* Assume ints. */ TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT; - TYPE_CODE (type) = TYPE_CODE_ENUM; + type->set_code (TYPE_CODE_ENUM); TYPE_NFIELDS (type) = nsyms; TYPE_FIELDS (type) = (struct field *) TYPE_ALLOC (type, sizeof (struct field) * nsyms); |