[PATCH 20/22] gdb: remove TYPE_FIXED_INSTANCE

Simon Marchi simon.marchi@efficios.com
Tue Aug 18 16:59:43 GMT 2020


gdb/ChangeLog:

	* gdbtypes.h (TYPE_FIXED_INSTANCE): Remove, replace all
	uses with type::is_fixed_instance.

Change-Id: I57731b5ab44aac7d8896a32b9c7481891baea51a
---
 gdb/ada-lang.c | 10 +++++-----
 gdb/gdbtypes.c |  2 +-
 gdb/gdbtypes.h | 24 +++++++++++-------------
 3 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index f1ed5d1f470..903a200f9cb 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -2938,7 +2938,7 @@ ada_array_bound_from_type (struct type *arr_type, int n, int which)
   else
     type = arr_type;
 
-  if (TYPE_FIXED_INSTANCE (type))
+  if (type->is_fixed_instance ())
     {
       /* The array has already been fixed, so we do not need to
 	 check the parallel ___XA type again.  That encoding has
@@ -8054,7 +8054,7 @@ template_to_static_fixed_type (struct type *type0)
   int f;
 
   /* No need no do anything if the input type is already fixed.  */
-  if (TYPE_FIXED_INSTANCE (type0))
+  if (type0->is_fixed_instance ())
     return type0;
 
   /* Likewise if we already have computed the static approximation.  */
@@ -8207,7 +8207,7 @@ to_fixed_record_type (struct type *type0, const gdb_byte *valaddr,
 {
   struct type *templ_type;
 
-  if (TYPE_FIXED_INSTANCE (type0))
+  if (type0->is_fixed_instance ())
     return type0;
 
   templ_type = dynamic_template_type (type0);
@@ -8363,7 +8363,7 @@ to_fixed_array_type (struct type *type0, struct value *dval,
   static const char *xa_suffix = "___XA";
 
   type0 = ada_check_typedef (type0);
-  if (TYPE_FIXED_INSTANCE (type0))
+  if (type0->is_fixed_instance ())
     return type0;
 
   constrained_packed_array_p = ada_is_constrained_packed_array_type (type0);
@@ -8683,7 +8683,7 @@ to_static_fixed_type (struct type *type0)
   if (type0 == NULL)
     return NULL;
 
-  if (TYPE_FIXED_INSTANCE (type0))
+  if (type0->is_fixed_instance ())
     return type0;
 
   type0 = ada_check_typedef (type0);
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 80f16d62283..6924ba307d9 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -5095,7 +5095,7 @@ recursive_dump_type (struct type *type, int spaces)
     {
       puts_filtered (" TYPE_VECTOR");
     }
-  if (TYPE_FIXED_INSTANCE (type))
+  if (type->is_fixed_instance ())
     {
       puts_filtered (" TYPE_FIXED_INSTANCE");
     }
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 6682769cca5..2d57424d589 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -216,18 +216,6 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags);
 
 #define TYPE_ENDIANITY_NOT_DEFAULT(t) (TYPE_MAIN_TYPE (t)->flag_endianity_not_default)
 
-/* * The debugging formats (especially STABS) do not contain enough
-   information to represent all Ada types---especially those whose
-   size depends on dynamic quantities.  Therefore, the GNAT Ada
-   compiler includes extra information in the form of additional type
-   definitions connected by naming conventions.  This flag indicates
-   that the type is an ordinary (unencoded) GDB type that has been
-   created from the necessary run-time information, and does not need
-   further interpretation.  Optionally marks ordinary, fixed-size GDB
-   type.  */
-
-#define TYPE_FIXED_INSTANCE(t) ((t)->is_fixed_instance ())
-
 /* * Not textual.  By default, GDB treats all single byte integers as
    characters (or elements of strings) unless this flag is set.  */
 
@@ -1141,6 +1129,16 @@ struct type
     this->main_type->m_flag_gnu_ifunc = is_gnu_ifunc;
   }
 
+  /* The debugging formats (especially STABS) do not contain enough
+     information to represent all Ada types---especially those whose
+     size depends on dynamic quantities.  Therefore, the GNAT Ada
+     compiler includes extra information in the form of additional type
+     definitions connected by naming conventions.  This flag indicates
+     that the type is an ordinary (unencoded) GDB type that has been
+     created from the necessary run-time information, and does not need
+     further interpretation.  Optionally marks ordinary, fixed-size GDB
+     type.  */
+
   bool is_fixed_instance () const
   {
     return this->main_type->m_flag_fixed_instance;
@@ -1660,7 +1658,7 @@ extern void allocate_gnat_aux_type (struct type *);
 #define ADA_TYPE_P(type)					\
   (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_GNAT_STUFF	\
     || (TYPE_SPECIFIC_FIELD (type) == TYPE_SPECIFIC_NONE	\
-	&& TYPE_FIXED_INSTANCE (type)))
+	&& (type)->is_fixed_instance ()))
 
 #define INIT_FUNC_SPECIFIC(type)					       \
   (TYPE_SPECIFIC_FIELD (type) = TYPE_SPECIFIC_FUNC,			       \
-- 
2.28.0



More information about the Gdb-patches mailing list