From 67607e24d0413828acdfa9bc38f6fbac40b860b9 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 14 May 2020 13:45:40 -0400 Subject: 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) : New methods. (TYPE_CODE): Use type::code. Change all call sites used to set the code to use type::set_code instead. --- gdb/mdebugread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/mdebugread.c') diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 5c4158c..621069e 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -1015,7 +1015,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, TYPE_NAME (t) = obconcat (&mdebugread_objfile->objfile_obstack, name, (char *) NULL); - TYPE_CODE (t) = type_code; + t->set_code (type_code); TYPE_LENGTH (t) = sh->value; TYPE_NFIELDS (t) = nfields; TYPE_FIELDS (t) = f = ((struct field *) @@ -1668,7 +1668,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, if (TYPE_CODE (tp) != type_code) { - TYPE_CODE (tp) = type_code; + tp->set_code (type_code); } /* Do not set the tag name if it is a compiler generated tag name @@ -1709,7 +1709,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs, if (TYPE_CODE (tp) != type_code) { bad_tag_guess_complaint (sym_name); - TYPE_CODE (tp) = type_code; + tp->set_code (type_code); } if (TYPE_NAME (tp) == NULL || strcmp (TYPE_NAME (tp), name) != 0) -- cgit v1.1