aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
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/dwarf2
parent02eba61aa6cad683e96cf13f483adc04982c0c2b (diff)
downloadbinutils-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/dwarf2')
-rw-r--r--gdb/dwarf2/read.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 27bf40a..4809202 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -9325,7 +9325,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
/* Smash this type to be a structure type. We have to do this
because the type has already been recorded. */
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
+ type->set_code (TYPE_CODE_STRUCT);
TYPE_NFIELDS (type) = 3;
/* Save the field we care about. */
struct field saved_field = TYPE_FIELD (type, 0);
@@ -9368,7 +9368,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
{
/* Smash this type to be a structure type. We have to do this
because the type has already been recorded. */
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
+ type->set_code (TYPE_CODE_STRUCT);
struct type *field_type = TYPE_FIELD_TYPE (type, 0);
const char *variant_name
@@ -9415,7 +9415,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
/* Smash this type to be a structure type. We have to do this
because the type has already been recorded. */
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
+ type->set_code (TYPE_CODE_STRUCT);
/* Make space for the discriminant field. */
struct field *disr_field = &TYPE_FIELD (disr_type, 0);
@@ -15369,15 +15369,15 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
if (die->tag == DW_TAG_structure_type)
{
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
+ type->set_code (TYPE_CODE_STRUCT);
}
else if (die->tag == DW_TAG_union_type)
{
- TYPE_CODE (type) = TYPE_CODE_UNION;
+ type->set_code (TYPE_CODE_UNION);
}
else
{
- TYPE_CODE (type) = TYPE_CODE_STRUCT;
+ type->set_code (TYPE_CODE_STRUCT);
}
if (cu->language == language_cplus && die->tag == DW_TAG_class_type)
@@ -15937,7 +15937,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
type = alloc_type (objfile);
- TYPE_CODE (type) = TYPE_CODE_ENUM;
+ type->set_code (TYPE_CODE_ENUM);
name = dwarf2_full_name (NULL, die, cu);
if (name != NULL)
TYPE_NAME (type) = name;