aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-07-30 22:43:54 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2022-09-21 10:59:49 -0400
commit27710edb4e588d0360620df424dd7ee7e8cfafee (patch)
treeaf4da9f4c7e032ab6653536f2a991cbe09cee759 /gdb/compile
parent8a50fdcefc44c40d5c4b978f19c22ddfbeb29139 (diff)
downloadgdb-27710edb4e588d0360620df424dd7ee7e8cfafee.zip
gdb-27710edb4e588d0360620df424dd7ee7e8cfafee.tar.gz
gdb-27710edb4e588d0360620df424dd7ee7e8cfafee.tar.bz2
gdb: remove TYPE_TARGET_TYPE
Remove the macro, replace all uses by calls to type::target_type. Change-Id: Ie51d3e1e22f94130176d6abd723255282bb6d1ed
Diffstat (limited to 'gdb/compile')
-rw-r--r--gdb/compile/compile-c-symbols.c4
-rw-r--r--gdb/compile/compile-c-types.c8
-rw-r--r--gdb/compile/compile-cplus-types.c12
-rw-r--r--gdb/compile/compile-object-load.c10
4 files changed, 17 insertions, 17 deletions
diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
index e1f94ec..dd892b3 100644
--- a/gdb/compile/compile-c-symbols.c
+++ b/gdb/compile/compile-c-symbols.c
@@ -495,7 +495,7 @@ generate_vla_size (compile_instance *compiler,
type = check_typedef (type);
if (TYPE_IS_REFERENCE (type))
- type = check_typedef (TYPE_TARGET_TYPE (type));
+ type = check_typedef (type->target_type ());
switch (type->code ())
{
@@ -518,7 +518,7 @@ generate_vla_size (compile_instance *compiler,
generate_vla_size (compiler, stream, gdbarch, registers_used, pc,
type->index_type (), sym);
generate_vla_size (compiler, stream, gdbarch, registers_used, pc,
- TYPE_TARGET_TYPE (type), sym);
+ type->target_type (), sym);
break;
case TYPE_CODE_UNION:
diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c
index 14dbd97..d92bd20 100644
--- a/gdb/compile/compile-c-types.c
+++ b/gdb/compile/compile-c-types.c
@@ -29,7 +29,7 @@
static gcc_type
convert_pointer (compile_c_instance *context, struct type *type)
{
- gcc_type target = context->convert_type (TYPE_TARGET_TYPE (type));
+ gcc_type target = context->convert_type (type->target_type ());
return context->plugin ().build_pointer_type (target);
}
@@ -42,7 +42,7 @@ convert_array (compile_c_instance *context, struct type *type)
gcc_type element_type;
struct type *range = type->index_type ();
- element_type = context->convert_type (TYPE_TARGET_TYPE (type));
+ element_type = context->convert_type (type->target_type ());
if (range->bounds ()->low.kind () != PROP_CONST)
return context->plugin ().error (_("array type with non-constant"
@@ -155,7 +155,7 @@ convert_func (compile_c_instance *context, struct type *type)
struct gcc_type_array array;
int is_varargs = type->has_varargs () || !type->is_prototyped ();
- struct type *target_type = TYPE_TARGET_TYPE (type);
+ struct type *target_type = type->target_type ();
/* Functions with no debug info have no return type. Ideally we'd
want to fallback to the type of the cast just before the
@@ -263,7 +263,7 @@ convert_qualified (compile_c_instance *context, struct type *type)
static gcc_type
convert_complex (compile_c_instance *context, struct type *type)
{
- gcc_type base = context->convert_type (TYPE_TARGET_TYPE (type));
+ gcc_type base = context->convert_type (type->target_type ());
return context->plugin ().build_complex_type (base);
}
diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index e7c940b..6f666e2 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -410,7 +410,7 @@ static gcc_type
compile_cplus_convert_reference (compile_cplus_instance *instance,
struct type *type)
{
- gcc_type target = instance->convert_type (TYPE_TARGET_TYPE (type));
+ gcc_type target = instance->convert_type (type->target_type ());
enum gcc_cp_ref_qualifiers quals = GCC_CP_REF_QUAL_NONE;
switch (type->code ())
@@ -442,7 +442,7 @@ static gcc_type
compile_cplus_convert_pointer (compile_cplus_instance *instance,
struct type *type)
{
- gcc_type target = instance->convert_type (TYPE_TARGET_TYPE (type));
+ gcc_type target = instance->convert_type (type->target_type ());
return instance->convert_pointer_base (target);
}
@@ -454,7 +454,7 @@ compile_cplus_convert_array (compile_cplus_instance *instance,
struct type *type)
{
struct type *range = type->index_type ();
- gcc_type element_type = instance->convert_type (TYPE_TARGET_TYPE (type));
+ gcc_type element_type = instance->convert_type (type->target_type ());
if (range->bounds ()->low.kind () != PROP_CONST)
{
@@ -697,7 +697,7 @@ compile_cplus_convert_memberptr (compile_cplus_instance *instance,
gcc_type class_type = instance->convert_type (containing_class);
gcc_type member_type
- = instance->convert_type (TYPE_TARGET_TYPE (type));
+ = instance->convert_type (type->target_type ());
return instance->plugin ().build_pointer_to_member_type
(class_type, member_type);
@@ -961,7 +961,7 @@ compile_cplus_convert_func (compile_cplus_instance *instance,
struct type *type, bool strip_artificial)
{
int is_varargs = type->has_varargs ();
- struct type *target_type = TYPE_TARGET_TYPE (type);
+ struct type *target_type = type->target_type ();
/* Functions with no debug info have no return type. Ideally we'd
want to fallback to the type of the cast just before the
@@ -1086,7 +1086,7 @@ static gcc_type
compile_cplus_convert_complex (compile_cplus_instance *instance,
struct type *type)
{
- gcc_type base = instance->convert_type (TYPE_TARGET_TYPE (type));
+ gcc_type base = instance->convert_type (type->target_type ());
return instance->plugin ().build_complex_type (base);
}
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 06e8c85..aede3bc 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -469,7 +469,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
gdb_ptr_type = check_typedef (gdb_ptr_type);
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));
+ gdb_type_from_ptr = check_typedef (gdb_ptr_type->target_type ());
if (types_deeply_equal (gdb_type, gdb_type_from_ptr))
{
@@ -489,7 +489,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
switch (gdb_type_from_ptr->code ())
{
case TYPE_CODE_ARRAY:
- gdb_type_from_ptr = TYPE_TARGET_TYPE (gdb_type_from_ptr);
+ gdb_type_from_ptr = gdb_type_from_ptr->target_type ();
break;
case TYPE_CODE_FUNC:
break;
@@ -500,7 +500,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
objfile_name (objfile));
}
if (!types_deeply_equal (gdb_type_from_ptr,
- TYPE_TARGET_TYPE (gdb_type)))
+ gdb_type->target_type ()))
error (_("Referenced types do not match for symbols \"%s\" and \"%s\" "
"in compiled module \"%s\"."),
COMPILE_I_EXPR_PTR_TYPE, COMPILE_I_EXPR_VAL,
@@ -530,7 +530,7 @@ get_regs_type (struct symbol *func_sym, struct objfile *objfile)
regsp_type->code (), GCC_FE_WRAPPER_FUNCTION,
objfile_name (objfile));
- regs_type = check_typedef (TYPE_TARGET_TYPE (regsp_type));
+ regs_type = check_typedef (regsp_type->target_type ());
if (regs_type->code () != TYPE_CODE_STRUCT)
error (_("Invalid type code %d of dereferenced first parameter "
"of function \"%s\" in compiled module \"%s\"."),
@@ -685,7 +685,7 @@ compile_object_load (const compile_file_names &file_names,
"module \"%s\"."),
func_type->num_fields (), GCC_FE_WRAPPER_FUNCTION,
objfile_name (objfile));
- if (!types_deeply_equal (expect_return_type, TYPE_TARGET_TYPE (func_type)))
+ if (!types_deeply_equal (expect_return_type, func_type->target_type ()))
error (_("Invalid return type of function \"%s\" in compiled "
"module \"%s\"."),
GCC_FE_WRAPPER_FUNCTION, objfile_name (objfile));