aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-09-23 23:35:24 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-10-29 16:44:20 -0400
commit8d939e8ea4b05a263579b533850a983668ccd1fa (patch)
tree2222080eda027228bf5fea5e6643591af5858a6f
parentd3771fe234b74d60cfa553940bce9d047bd38e8d (diff)
downloadgdb-8d939e8ea4b05a263579b533850a983668ccd1fa.zip
gdb-8d939e8ea4b05a263579b533850a983668ccd1fa.tar.gz
gdb-8d939e8ea4b05a263579b533850a983668ccd1fa.tar.bz2
gdb: remove FIELD_LOC_KIND macro
Remove FIELD_LOC_KIND, replace its uses with field::loc_kind or call_site_target::loc_kind. Change-Id: I0368d8c3ea269d491bb215aa70e32edbdf55f389
-rw-r--r--gdb/dwarf2/loc.c2
-rw-r--r--gdb/gdbtypes.c10
-rw-r--r--gdb/gdbtypes.h3
3 files changed, 7 insertions, 8 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 33f0d99..1054b01 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -640,7 +640,7 @@ call_site_to_target_addr (struct gdbarch *call_site_gdbarch,
struct call_site *call_site,
struct frame_info *caller_frame)
{
- switch (FIELD_LOC_KIND (call_site->target))
+ switch (call_site->target.loc_kind ())
{
case FIELD_LOC_KIND_DWARF_BLOCK:
{
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index c947215..622f314 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4204,11 +4204,11 @@ check_types_equal (struct type *type1, struct type *type2,
if (FIELD_ARTIFICIAL (*field1) != FIELD_ARTIFICIAL (*field2)
|| FIELD_BITSIZE (*field1) != FIELD_BITSIZE (*field2)
- || FIELD_LOC_KIND (*field1) != FIELD_LOC_KIND (*field2))
+ || field1->loc_kind () != field2->loc_kind ())
return false;
if (!compare_maybe_null_strings (field1->name (), field2->name ()))
return false;
- switch (FIELD_LOC_KIND (*field1))
+ switch (field1->loc_kind ())
{
case FIELD_LOC_KIND_BITPOS:
if (FIELD_BITPOS (*field1) != FIELD_BITPOS (*field2))
@@ -4245,7 +4245,7 @@ check_types_equal (struct type *type1, struct type *type2,
default:
internal_error (__FILE__, __LINE__, _("Unsupported field kind "
"%d by check_types_equal"),
- FIELD_LOC_KIND (*field1));
+ field1->loc_kind ());
}
worklist->emplace_back (field1->type (), field2->type ());
@@ -4891,8 +4891,8 @@ field_is_static (struct field *f)
have a dedicated flag that would be set for static fields when
the type is being created. But in practice, checking the field
loc_kind should give us an accurate answer. */
- return (FIELD_LOC_KIND (*f) == FIELD_LOC_KIND_PHYSNAME
- || FIELD_LOC_KIND (*f) == FIELD_LOC_KIND_PHYSADDR);
+ return (f->loc_kind () == FIELD_LOC_KIND_PHYSNAME
+ || f->loc_kind () == FIELD_LOC_KIND_PHYSADDR);
}
static void
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index f36a753..f1c8d43 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -2125,7 +2125,6 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \
: B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (index)))
-#define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind ())
#define FIELD_BITPOS(thisfld) ((thisfld).loc_bitpos ())
#define FIELD_ENUMVAL(thisfld) ((thisfld).loc_enumval ())
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc_physname ())
@@ -2134,7 +2133,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
#define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial)
#define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
-#define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND ((thistype)->field (n))
+#define TYPE_FIELD_LOC_KIND(thistype, n) ((thistype)->field (n).loc_kind ())
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS ((thistype)->field (n))
#define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL ((thistype)->field (n))
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME ((thistype)->field (n))