aboutsummaryrefslogtreecommitdiff
path: root/gdb/stabsread.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-05-14 13:45:40 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-05-14 13:45:40 -0400
commit67607e24d0413828acdfa9bc38f6fbac40b860b9 (patch)
tree244fb4d92616ef31b9b22197d5a90df09e0147b2 /gdb/stabsread.c
parent02eba61aa6cad683e96cf13f483adc04982c0c2b (diff)
downloadgdb-67607e24d0413828acdfa9bc38f6fbac40b860b9.zip
gdb-67607e24d0413828acdfa9bc38f6fbac40b860b9.tar.gz
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/stabsread.c')
-rw-r--r--gdb/stabsread.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index eac4740..5601c80 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -1687,7 +1687,7 @@ again:
fill in the rest of the fields when we get the full
type. */
type = dbx_alloc_type (typenums, objfile);
- TYPE_CODE (type) = code;
+ type->set_code (code);
TYPE_NAME (type) = type_name;
INIT_CPLUS_SPECIFIC (type);
TYPE_STUB (type) = 1;
@@ -1716,14 +1716,14 @@ again:
/* Allocate and enter the typedef type first.
This handles recursive types. */
type = dbx_alloc_type (typenums, objfile);
- TYPE_CODE (type) = TYPE_CODE_TYPEDEF;
+ type->set_code (TYPE_CODE_TYPEDEF);
{
struct type *xtype = read_type (pp, objfile);
if (type == xtype)
{
/* It's being defined as itself. That means it is "void". */
- TYPE_CODE (type) = TYPE_CODE_VOID;
+ type->set_code (TYPE_CODE_VOID);
TYPE_LENGTH (type) = 1;
}
else if (type_size >= 0 || is_string)
@@ -2022,7 +2022,7 @@ again:
type = dbx_alloc_type (typenums, objfile);
type = read_array_type (pp, type, objfile);
if (is_string)
- TYPE_CODE (type) = TYPE_CODE_STRING;
+ type->set_code (TYPE_CODE_STRING);
if (is_vector)
make_vector_type (type);
break;
@@ -2370,7 +2370,7 @@ read_member_functions (struct stab_field_info *fip, const char **pp,
/* These are methods, not functions. */
if (TYPE_CODE (new_sublist->fn_field.type) == TYPE_CODE_FUNC)
- TYPE_CODE (new_sublist->fn_field.type) = TYPE_CODE_METHOD;
+ new_sublist->fn_field.type->set_code (TYPE_CODE_METHOD);
else
gdb_assert (TYPE_CODE (new_sublist->fn_field.type)
== TYPE_CODE_METHOD);
@@ -3477,7 +3477,7 @@ read_struct_type (const char **pp, struct type *type, enum type_code type_code,
}
INIT_CPLUS_SPECIFIC (type);
- TYPE_CODE (type) = type_code;
+ type->set_code (type_code);
TYPE_STUB (type) = 0;
/* First comes the total size in bytes. */
@@ -3652,7 +3652,7 @@ read_enum_type (const char **pp, struct type *type,
TYPE_LENGTH (type) = gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT;
set_length_in_type_chain (type);
- TYPE_CODE (type) = TYPE_CODE_ENUM;
+ type->set_code (TYPE_CODE_ENUM);
TYPE_STUB (type) = 0;
if (unsigned_enum)
TYPE_UNSIGNED (type) = 1;