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

@@ -146,9 +146,9 @@ dwarf_expr_context::fetch (int n)
static void
dwarf_require_integral (struct type *type)
{
if (TYPE_CODE (type) != TYPE_CODE_INT
&& TYPE_CODE (type) != TYPE_CODE_CHAR
&& TYPE_CODE (type) != TYPE_CODE_BOOL)
if (type->code () != TYPE_CODE_INT
&& type->code () != TYPE_CODE_CHAR
&& type->code () != TYPE_CODE_BOOL)
error (_("integral type expected in DWARF expression"));
}
@@ -363,7 +363,7 @@ dwarf_expr_require_composition (const gdb_byte *op_ptr, const gdb_byte *op_end,
static int
base_types_equal_p (struct type *t1, struct type *t2)
{
if (TYPE_CODE (t1) != TYPE_CODE (t2))
if (t1->code () != t2->code ())
return 0;
if (TYPE_UNSIGNED (t1) != TYPE_UNSIGNED (t2))
return 0;