[2/7] gdb: remove FIELD_ARTIFICIAL

Message ID 20230831154727.1240363-3-simon.marchi@efficios.com
State New
Headers
Series Remove some more TYPE/FIELD macros |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Patch failed to apply

Commit Message

Simon Marchi Aug. 31, 2023, 3:46 p.m. UTC
  From: Simon Marchi <simon.marchi@polymtl.ca>

Replace uses with field::is_artificial.

Change-Id: I599616fdd9f4b6d044de492e8151aa6130725cd1
---
 gdb/c-typeprint.c    | 2 +-
 gdb/gdbtypes.c       | 2 +-
 gdb/gdbtypes.h       | 3 +--
 gdb/guile/scm-type.c | 2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)
  

Patch

diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 416f63bacf52..57b2c09be8bf 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -286,7 +286,7 @@  cp_type_print_method_args (struct type *mtype, const char *prefix,
 
       struct field arg = args[i];
       /* Skip any artificial arguments.  */
-      if (FIELD_ARTIFICIAL (arg))
+      if (arg.is_artificial ())
 	continue;
 
       if (printed_args > 0)
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index ca168b31529f..076a0817b265 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4243,7 +4243,7 @@  check_types_equal (struct type *type1, struct type *type2,
 	  const struct field *field1 = &type1->field (i);
 	  const struct field *field2 = &type2->field (i);
 
-	  if (FIELD_ARTIFICIAL (*field1) != FIELD_ARTIFICIAL (*field2)
+	  if (field1->is_artificial () != field2->is_artificial ()
 	      || FIELD_BITSIZE (*field1) != FIELD_BITSIZE (*field2)
 	      || field1->loc_kind () != field2->loc_kind ())
 	    return false;
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 43263a90714d..9aa4a5c8a856 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1923,10 +1923,9 @@  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_ARTIFICIAL(thisfld) ((thisfld).is_artificial ())
 #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize)
 
-#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL((thistype)->field (n))
+#define TYPE_FIELD_ARTIFICIAL(thistype, n) ((thistype)->field (n).is_artificial ())
 #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE((thistype)->field (n))
 #define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE((thistype)->field (n))!=0)
 
diff --git a/gdb/guile/scm-type.c b/gdb/guile/scm-type.c
index 033b800d8b0a..3b0a27524182 100644
--- a/gdb/guile/scm-type.c
+++ b/gdb/guile/scm-type.c
@@ -1213,7 +1213,7 @@  gdbscm_field_artificial_p (SCM self)
     = tyscm_get_field_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct field *field = tyscm_field_smob_to_field (f_smob);
 
-  return scm_from_bool (FIELD_ARTIFICIAL (*field));
+  return scm_from_bool (field->is_artificial ());
 }
 
 /* (field-baseclass? <gdb:field>) -> boolean