]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove TYPE_POINTER_TYPE
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 16 Mar 2026 14:25:20 +0000 (10:25 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 16 Mar 2026 17:24:45 +0000 (13:24 -0400)
IMO, there is no point in keeping this macro.  Remove it and access the
field directly.  If we ever want some kind of abstraction in front of
the field, then we'll add a method.

Change-Id: I592789130ad81776c7a8b39c4721ebb4aa7293f7
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/p-exp.y

index 896b3afe66a408668ac16a4d2f422c085ca3cd22..8ebe9948bd2321d85b583e55371f8aa390320426 100644 (file)
@@ -368,14 +368,14 @@ make_pointer_type (type *type)
   struct type *ntype;  /* New type */
   struct type *chain;
 
-  ntype = TYPE_POINTER_TYPE (type);
+  ntype = type->pointer_type;
 
   if (ntype)
     return ntype;
 
   ntype = type_allocator (type).new_type ();
   ntype->set_target_type (type);
-  TYPE_POINTER_TYPE (type) = ntype;
+  type->pointer_type = ntype;
 
   /* FIXME!  Assumes the machine has only one representation for pointers!  */
 
@@ -614,7 +614,7 @@ make_qualified_type (struct type *type, type_instance_flags new_flags,
 
   /* Pointers or references to the original type are not relevant to
      the new type.  */
-  TYPE_POINTER_TYPE (ntype) = (struct type *) 0;
+  ntype->pointer_type = (struct type *) 0;
   TYPE_REFERENCE_TYPE (ntype) = (struct type *) 0;
 
   /* Chain the new qualified type to the old type.  */
@@ -4985,7 +4985,7 @@ recursive_dump_type (struct type *type, int spaces)
       recursive_dump_type (type->target_type (), spaces + 2);
     }
   gdb_printf ("%*spointer_type %s\n", spaces, "",
-             host_address_to_string (TYPE_POINTER_TYPE (type)));
+             host_address_to_string (type->pointer_type));
   gdb_printf ("%*sreference_type %s\n", spaces, "",
              host_address_to_string (TYPE_REFERENCE_TYPE (type)));
   gdb_printf ("%*stype_chain %s\n", spaces, "",
index 2058f2c8bb94ae9d09a20ae65c48d570adac5e63..5bbaa846dc33df41a2ded9cb0a5887bf683a1f0f 100644 (file)
@@ -1897,7 +1897,6 @@ extern void allocate_gnat_aux_type (struct type *);
   (TYPE_SPECIFIC_FIELD (type) = TYPE_SPECIFIC_FIXED_POINT, \
    allocate_fixed_point_type_info (type))
 
-#define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type
 #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type
 #define TYPE_RVALUE_REFERENCE_TYPE(thistype) (thistype)->rvalue_reference_type
 #define TYPE_CHAIN(thistype) (thistype)->chain
index 37831be907481d0e65d53a884416103cb76f84d7..c06ada3b7ff8aae834dcc78dccec9fc7f70fd454 100644 (file)
@@ -222,7 +222,7 @@ exp :       exp '^'   %prec UNARY
 exp    :       '@' exp    %prec UNARY
                        { pstate->wrap<unop_addr_operation> ();
                          if (current_type)
-                           current_type = TYPE_POINTER_TYPE (current_type); }
+                           current_type = current_type->pointer_type; }
        ;
 
 exp    :       '-' exp    %prec UNARY