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

@@ -452,7 +452,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
error (_("No \"%s\" symbol found"), COMPILE_I_EXPR_PTR_TYPE);
gdb_ptr_type = SYMBOL_TYPE (gdb_ptr_type_sym);
gdb_ptr_type = check_typedef (gdb_ptr_type);
if (TYPE_CODE (gdb_ptr_type) != TYPE_CODE_PTR)
if (gdb_ptr_type->code () != TYPE_CODE_PTR)
error (_("Type of \"%s\" is not a pointer"), COMPILE_I_EXPR_PTR_TYPE);
gdb_type_from_ptr = check_typedef (TYPE_TARGET_TYPE (gdb_ptr_type));
@@ -464,14 +464,14 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
return gdb_type;
}
if (TYPE_CODE (gdb_type) != TYPE_CODE_PTR)
if (gdb_type->code () != TYPE_CODE_PTR)
error (_("Invalid type code %d of symbol \"%s\" "
"in compiled module \"%s\"."),
TYPE_CODE (gdb_type_from_ptr), COMPILE_I_EXPR_VAL,
gdb_type_from_ptr->code (), COMPILE_I_EXPR_VAL,
objfile_name (objfile));
retval = gdb_type_from_ptr;
switch (TYPE_CODE (gdb_type_from_ptr))
switch (gdb_type_from_ptr->code ())
{
case TYPE_CODE_ARRAY:
gdb_type_from_ptr = TYPE_TARGET_TYPE (gdb_type_from_ptr);
@@ -481,7 +481,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
default:
error (_("Invalid type code %d of symbol \"%s\" "
"in compiled module \"%s\"."),
TYPE_CODE (gdb_type_from_ptr), COMPILE_I_EXPR_PTR_TYPE,
gdb_type_from_ptr->code (), COMPILE_I_EXPR_PTR_TYPE,
objfile_name (objfile));
}
if (!types_deeply_equal (gdb_type_from_ptr,
@@ -509,17 +509,17 @@ get_regs_type (struct symbol *func_sym, struct objfile *objfile)
return NULL;
regsp_type = check_typedef (TYPE_FIELD_TYPE (func_type, 0));
if (TYPE_CODE (regsp_type) != TYPE_CODE_PTR)
if (regsp_type->code () != TYPE_CODE_PTR)
error (_("Invalid type code %d of first parameter of function \"%s\" "
"in compiled module \"%s\"."),
TYPE_CODE (regsp_type), GCC_FE_WRAPPER_FUNCTION,
regsp_type->code (), GCC_FE_WRAPPER_FUNCTION,
objfile_name (objfile));
regs_type = check_typedef (TYPE_TARGET_TYPE (regsp_type));
if (TYPE_CODE (regs_type) != TYPE_CODE_STRUCT)
if (regs_type->code () != TYPE_CODE_STRUCT)
error (_("Invalid type code %d of dereferenced first parameter "
"of function \"%s\" in compiled module \"%s\"."),
TYPE_CODE (regs_type), GCC_FE_WRAPPER_FUNCTION,
regs_type->code (), GCC_FE_WRAPPER_FUNCTION,
objfile_name (objfile));
return regs_type;
@@ -555,10 +555,10 @@ store_regs (struct type *regs_type, CORE_ADDR regs_base)
reg_name, pulongest (reg_bitpos), pulongest (reg_bitsize));
reg_offset = reg_bitpos / 8;
if (TYPE_CODE (reg_type) != TYPE_CODE_INT
&& TYPE_CODE (reg_type) != TYPE_CODE_PTR)
if (reg_type->code () != TYPE_CODE_INT
&& reg_type->code () != TYPE_CODE_PTR)
error (_("Invalid register \"%s\" type code %d"), reg_name,
TYPE_CODE (reg_type));
reg_type->code ());
regnum = compile_register_name_demangle (gdbarch, reg_name);
@@ -646,10 +646,10 @@ compile_object_load (const compile_file_names &file_names,
error (_("Cannot find function \"%s\" in compiled module \"%s\"."),
GCC_FE_WRAPPER_FUNCTION, objfile_name (objfile));
func_type = SYMBOL_TYPE (func_sym);
if (TYPE_CODE (func_type) != TYPE_CODE_FUNC)
if (func_type->code () != TYPE_CODE_FUNC)
error (_("Invalid type code %d of function \"%s\" in compiled "
"module \"%s\"."),
TYPE_CODE (func_type), GCC_FE_WRAPPER_FUNCTION,
func_type->code (), GCC_FE_WRAPPER_FUNCTION,
objfile_name (objfile));
switch (scope)