gdb: remove TYPE_CODE macro

Remove TYPE_CODE, changing all the call sites to use type::code
directly.  This is quite a big diff, but this was mostly done using sed
and coccinelle.  A few call sites were done by hand.

gdb/ChangeLog:

	* gdbtypes.h (TYPE_CODE): Remove.  Change all call sites to use
	type::code instead.
This commit is contained in:
Simon Marchi
2020-05-14 13:46:38 -04:00
parent 67607e24d0
commit 7813437494
145 changed files with 1744 additions and 1746 deletions

View File

@@ -74,25 +74,25 @@ cp_is_vtbl_member (struct type *type)
{
/* With older versions of g++, the vtbl field pointed to an array of
structures. Nowadays it points directly to the structure. */
if (TYPE_CODE (type) == TYPE_CODE_PTR)
if (type->code () == TYPE_CODE_PTR)
{
type = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
if (type->code () == TYPE_CODE_ARRAY)
{
type = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (type) == TYPE_CODE_STRUCT /* if not using thunks */
|| TYPE_CODE (type) == TYPE_CODE_PTR) /* if using thunks */
if (type->code () == TYPE_CODE_STRUCT /* if not using thunks */
|| type->code () == TYPE_CODE_PTR) /* if using thunks */
{
/* Virtual functions tables are full of pointers
to virtual functions. */
return cp_is_vtbl_ptr_type (type);
}
}
else if (TYPE_CODE (type) == TYPE_CODE_STRUCT) /* if not using thunks */
else if (type->code () == TYPE_CODE_STRUCT) /* if not using thunks */
{
return cp_is_vtbl_ptr_type (type);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR) /* if using thunks */
else if (type->code () == TYPE_CODE_PTR) /* if using thunks */
{
/* The type name of the thunk pointer is NULL when using
dwarf2. We could test for a pointer to a function, but
@@ -563,7 +563,7 @@ cp_print_static_field (struct type *type,
}
struct type *real_type = check_typedef (type);
if (TYPE_CODE (real_type) == TYPE_CODE_STRUCT)
if (real_type->code () == TYPE_CODE_STRUCT)
{
CORE_ADDR *first_dont_print;
CORE_ADDR addr = value_address (val);
@@ -591,7 +591,7 @@ cp_print_static_field (struct type *type,
return;
}
if (TYPE_CODE (real_type) == TYPE_CODE_ARRAY)
if (real_type->code () == TYPE_CODE_ARRAY)
{
struct type **first_dont_print;
int i;