aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-06-08 15:26:20 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-06-08 15:26:31 -0400
commit940da03e32c28144134d0373faf7fd5ea158f1ae (patch)
treea104a5666df69b0a45c5e5d04aba70cb10410dad /gdb/compile
parentb6cdac4b80c1d32726227305e16483cef9d40e2c (diff)
downloadgdb-940da03e32c28144134d0373faf7fd5ea158f1ae.zip
gdb-940da03e32c28144134d0373faf7fd5ea158f1ae.tar.gz
gdb-940da03e32c28144134d0373faf7fd5ea158f1ae.tar.bz2
gdb: remove TYPE_FIELD_TYPE macro
Remove the `TYPE_FIELD_TYPE` macro, changing all the call sites to use `type::field` and `field::type` directly. gdb/ChangeLog: * gdbtypes.h (TYPE_FIELD_TYPE): Remove. Change all call sites to use type::field and field::type instead. Change-Id: Ifda6226a25c811cfd334a756a9fbc5c0afdddff3
Diffstat (limited to 'gdb/compile')
-rw-r--r--gdb/compile/compile-c-symbols.c2
-rw-r--r--gdb/compile/compile-c-types.c6
-rw-r--r--gdb/compile/compile-cplus-types.c6
-rw-r--r--gdb/compile/compile-object-load.c6
-rw-r--r--gdb/compile/compile-object-run.c4
5 files changed, 12 insertions, 12 deletions
diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
index 84148fa..4ff757a 100644
--- a/gdb/compile/compile-c-symbols.c
+++ b/gdb/compile/compile-c-symbols.c
@@ -529,7 +529,7 @@ generate_vla_size (compile_instance *compiler,
for (i = 0; i < type->num_fields (); ++i)
if (!field_is_static (&type->field (i)))
generate_vla_size (compiler, stream, gdbarch, registers_used, pc,
- TYPE_FIELD_TYPE (type, i), sym);
+ type->field (i).type (), sym);
}
break;
}
diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c
index 3cf89fd..aad3588 100644
--- a/gdb/compile/compile-c-types.c
+++ b/gdb/compile/compile-c-types.c
@@ -108,9 +108,9 @@ convert_struct_or_union (compile_c_instance *context, struct type *type)
gcc_type field_type;
unsigned long bitsize = TYPE_FIELD_BITSIZE (type, i);
- field_type = context->convert_type (TYPE_FIELD_TYPE (type, i));
+ field_type = context->convert_type (type->field (i).type ());
if (bitsize == 0)
- bitsize = 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (type, i));
+ bitsize = 8 * TYPE_LENGTH (type->field (i).type ());
context->plugin ().build_add_field (result,
TYPE_FIELD_NAME (type, i),
field_type,
@@ -178,7 +178,7 @@ convert_func (compile_c_instance *context, struct type *type)
array.n_elements = type->num_fields ();
array.elements = XNEWVEC (gcc_type, type->num_fields ());
for (i = 0; i < type->num_fields (); ++i)
- array.elements[i] = context->convert_type (TYPE_FIELD_TYPE (type, i));
+ array.elements[i] = context->convert_type (type->field (i).type ());
result = context->plugin ().build_function_type (return_type,
&array, is_varargs);
diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index 20d84a5..b04d6c6 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -593,7 +593,7 @@ compile_cplus_convert_struct_or_union_members
field_name = nullptr;
gcc_type field_type
- = instance->convert_type (TYPE_FIELD_TYPE (type, i));
+ = instance->convert_type (type->field (i).type ());
if (field_is_static (&type->field (i)))
{
@@ -648,7 +648,7 @@ compile_cplus_convert_struct_or_union_members
| get_field_access_flag (type, i);
if (bitsize == 0)
- bitsize = 8 * TYPE_LENGTH (TYPE_FIELD_TYPE (type, i));
+ bitsize = 8 * TYPE_LENGTH (type->field (i).type ());
instance->plugin ().build_field
(field_name, field_type, field_flags, bitsize,
@@ -998,7 +998,7 @@ compile_cplus_convert_func (compile_cplus_instance *instance,
else
{
array.elements[i - artificials]
- = instance->convert_type (TYPE_FIELD_TYPE (type, i));
+ = instance->convert_type (type->field (i).type ());
}
}
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index 7f5f593..2f41607 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -508,7 +508,7 @@ get_regs_type (struct symbol *func_sym, struct objfile *objfile)
if (func_type->num_fields () == 0)
return NULL;
- regsp_type = check_typedef (TYPE_FIELD_TYPE (func_type, 0));
+ regsp_type = check_typedef (func_type->field (0).type ());
if (regsp_type->code () != TYPE_CODE_PTR)
error (_("Invalid type code %d of first parameter of function \"%s\" "
"in compiled module \"%s\"."),
@@ -540,8 +540,8 @@ store_regs (struct type *regs_type, CORE_ADDR regs_base)
ULONGEST reg_bitpos = TYPE_FIELD_BITPOS (regs_type, fieldno);
ULONGEST reg_bitsize = TYPE_FIELD_BITSIZE (regs_type, fieldno);
ULONGEST reg_offset;
- struct type *reg_type = check_typedef (TYPE_FIELD_TYPE (regs_type,
- fieldno));
+ struct type *reg_type
+ = check_typedef (regs_type->field (fieldno).type ());
ULONGEST reg_size = TYPE_LENGTH (reg_type);
int regnum;
struct value *regval;
diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c
index d8e2853..a2f3990 100644
--- a/gdb/compile/compile-object-run.c
+++ b/gdb/compile/compile-object-run.c
@@ -158,14 +158,14 @@ compile_object_run (struct compile_module *module)
{
gdb_assert (regs_addr != 0);
vargs[current_arg] = value_from_pointer
- (TYPE_FIELD_TYPE (func_type, current_arg), regs_addr);
+ (func_type->field (current_arg).type (), regs_addr);
++current_arg;
}
if (func_type->num_fields () >= 2)
{
gdb_assert (data->out_value_addr != 0);
vargs[current_arg] = value_from_pointer
- (TYPE_FIELD_TYPE (func_type, current_arg), data->out_value_addr);
+ (func_type->field (current_arg).type (), data->out_value_addr);
++current_arg;
}
gdb_assert (current_arg == func_type->num_fields ());