aboutsummaryrefslogtreecommitdiff
path: root/gdb/ctfread.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/ctfread.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/ctfread.c')
-rw-r--r--gdb/ctfread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/ctfread.c b/gdb/ctfread.c
index 8cc7271..06c036d 100644
--- a/gdb/ctfread.c
+++ b/gdb/ctfread.c
@@ -600,9 +600,9 @@ read_structure_type (struct ctf_context *ccp, ctf_id_t tid)
kind = ctf_type_kind (fp, tid);
if (kind == CTF_K_UNION)
- 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);
TYPE_LENGTH (type) = ctf_type_size (fp, tid);
set_type_align (type, ctf_type_align (fp, tid));
@@ -656,7 +656,7 @@ read_func_kind_type (struct ctf_context *ccp, ctf_id_t tid)
if (name != NULL && strlen (name.get ()) != 0)
TYPE_NAME (type) = obstack_strdup (&of->objfile_obstack, name.get ());
- TYPE_CODE (type) = TYPE_CODE_FUNC;
+ type->set_code (TYPE_CODE_FUNC);
ctf_func_type_info (fp, tid, &cfi);
rettype = get_tid_type (of, cfi.ctc_return);
TYPE_TARGET_TYPE (type) = rettype;
@@ -682,7 +682,7 @@ read_enum_type (struct ctf_context *ccp, ctf_id_t tid)
if (name != NULL && strlen (name.get ()) != 0)
TYPE_NAME (type) = obstack_strdup (&of->objfile_obstack, name.get ());
- TYPE_CODE (type) = TYPE_CODE_ENUM;
+ type->set_code (TYPE_CODE_ENUM);
TYPE_LENGTH (type) = ctf_type_size (fp, tid);
ctf_func_type_info (fp, tid, &fi);
target_type = get_tid_type (of, fi.ctc_return);