aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-08-30 11:49:49 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-09-30 22:05:57 -0400
commit33d16dd987d16fe1eb289853e5a444192bb31d9e (patch)
tree06c5ec20fad9309ab4dace3b6c659fa518d272af /gdb/compile
parentd3fd12dfc52cf4cbb910830e3ff60dca111f7468 (diff)
downloadgdb-33d16dd987d16fe1eb289853e5a444192bb31d9e.zip
gdb-33d16dd987d16fe1eb289853e5a444192bb31d9e.tar.gz
gdb-33d16dd987d16fe1eb289853e5a444192bb31d9e.tar.bz2
gdb: remove TYPE_FIELD_NAME and FIELD_NAME macros
Remove the `TYPE_FIELD_NAME` and `FIELD_NAME` macros, changing all the call sites to use field::name directly. Change-Id: I6900ae4e1ffab1396e24fb3298e94bf123826ca6
Diffstat (limited to 'gdb/compile')
-rw-r--r--gdb/compile/compile-c-types.c4
-rw-r--r--gdb/compile/compile-cplus-types.c4
-rw-r--r--gdb/compile/compile-object-load.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/gdb/compile/compile-c-types.c b/gdb/compile/compile-c-types.c
index eaeb832..e9e5398 100644
--- a/gdb/compile/compile-c-types.c
+++ b/gdb/compile/compile-c-types.c
@@ -112,7 +112,7 @@ convert_struct_or_union (compile_c_instance *context, struct type *type)
if (bitsize == 0)
bitsize = 8 * TYPE_LENGTH (type->field (i).type ());
context->plugin ().build_add_field (result,
- TYPE_FIELD_NAME (type, i),
+ type->field (i).name (),
field_type,
bitsize,
TYPE_FIELD_BITPOS (type, i));
@@ -137,7 +137,7 @@ convert_enum (compile_c_instance *context, struct type *type)
for (i = 0; i < type->num_fields (); ++i)
{
context->plugin ().build_add_enum_constant
- (result, TYPE_FIELD_NAME (type, i), TYPE_FIELD_ENUMVAL (type, i));
+ (result, type->field (i).name (), TYPE_FIELD_ENUMVAL (type, i));
}
context->plugin ().finish_enum_type (result);
diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index 71ad679..8871de1 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -582,7 +582,7 @@ compile_cplus_convert_struct_or_union_members
{
for (int i = TYPE_N_BASECLASSES (type); i < type->num_fields (); ++i)
{
- const char *field_name = TYPE_FIELD_NAME (type, i);
+ const char *field_name = type->field (i).name ();
if (TYPE_FIELD_IGNORE (type, i)
|| TYPE_FIELD_ARTIFICIAL (type, i))
@@ -937,7 +937,7 @@ compile_cplus_convert_enum (compile_cplus_instance *instance, struct type *type,
for (int i = 0; i < type->num_fields (); ++i)
{
gdb::unique_xmalloc_ptr<char> fname
- = compile_cplus_instance::decl_name (TYPE_FIELD_NAME (type, i));
+ = compile_cplus_instance::decl_name (type->field (i).name ());
if (TYPE_FIELD_LOC_KIND (type, i) != FIELD_LOC_KIND_ENUMVAL
|| fname == nullptr)
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index a25eb61..f28bf26 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -552,7 +552,7 @@ store_regs (struct type *regs_type, CORE_ADDR regs_base)
for (fieldno = 0; fieldno < regs_type->num_fields (); fieldno++)
{
- const char *reg_name = TYPE_FIELD_NAME (regs_type, fieldno);
+ const char *reg_name = regs_type->field (fieldno).name ();
ULONGEST reg_bitpos = TYPE_FIELD_BITPOS (regs_type, fieldno);
ULONGEST reg_bitsize = TYPE_FIELD_BITSIZE (regs_type, fieldno);
ULONGEST reg_offset;