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/ada-lang.c | |
parent | 02eba61aa6cad683e96cf13f483adc04982c0c2b (diff) | |
download | binutils-67607e24d0413828acdfa9bc38f6fbac40b860b9.zip binutils-67607e24d0413828acdfa9bc38f6fbac40b860b9.tar.gz binutils-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/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index bce0bb6..9bed643 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -8027,7 +8027,7 @@ empty_record (struct type *templ) { struct type *type = alloc_type_copy (templ); - TYPE_CODE (type) = TYPE_CODE_STRUCT; + type->set_code (TYPE_CODE_STRUCT); TYPE_NFIELDS (type) = 0; TYPE_FIELDS (type) = NULL; INIT_NONE_SPECIFIC (type); @@ -8083,7 +8083,7 @@ ada_template_to_fixed_record_type_1 (struct type *type, } rtype = alloc_type_copy (type); - TYPE_CODE (rtype) = TYPE_CODE_STRUCT; + rtype->set_code (TYPE_CODE_STRUCT); INIT_NONE_SPECIFIC (rtype); TYPE_NFIELDS (rtype) = nfields; TYPE_FIELDS (rtype) = (struct field *) @@ -8358,7 +8358,7 @@ template_to_static_fixed_type (struct type *type0) if (type == type0) { TYPE_TARGET_TYPE (type0) = type = alloc_type_copy (type0); - TYPE_CODE (type) = TYPE_CODE (type0); + type->set_code (TYPE_CODE(type0)); INIT_NONE_SPECIFIC (type); TYPE_NFIELDS (type) = nfields; TYPE_FIELDS (type) = (struct field *) @@ -8407,7 +8407,7 @@ to_record_with_fixed_variant_part (struct type *type, const gdb_byte *valaddr, dval = dval0; rtype = alloc_type_copy (type); - TYPE_CODE (rtype) = TYPE_CODE_STRUCT; + rtype->set_code (TYPE_CODE_STRUCT); INIT_NONE_SPECIFIC (rtype); TYPE_NFIELDS (rtype) = nfields; TYPE_FIELDS (rtype) = @@ -10376,7 +10376,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, /* The result type will have code OP_STRING, bashed there from OP_ARRAY. Bash it back. */ if (TYPE_CODE (value_type (result)) == TYPE_CODE_STRING) - TYPE_CODE (value_type (result)) = TYPE_CODE_ARRAY; + value_type (result)->set_code (TYPE_CODE_ARRAY); return result; } |