]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Change type_stack::insert to take gdbarch
authorTom Tromey <tom@tromey.com>
Sat, 23 Aug 2025 17:51:03 +0000 (11:51 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 10 Sep 2025 00:24:32 +0000 (18:24 -0600)
This changes type_stack::insert to take a gdbarch rather than an
expr_builder.  This is simpler and means that type_stack doesn't have
to know anything about expression building; the parser-defs.h include
can be removed.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/c-exp.y
gdb/type-stack.c
gdb/type-stack.h

index 3abfafe4b525691bcbcc3d31cf7675da561eab8f..11f0d88bfc02b4d8ad55a7039897d2a01daf1fa3 100644 (file)
@@ -1248,12 +1248,12 @@ single_qualifier:
                        { cpstate->type_stack.insert (tp_restrict); }
        |       '@' NAME
                {
-                 cpstate->type_stack.insert (pstate,
+                 cpstate->type_stack.insert (pstate->gdbarch (),
                                              copy_name ($2.stoken).c_str ());
                }
        |       '@' UNKNOWN_CPP_NAME
                {
-                 cpstate->type_stack.insert (pstate,
+                 cpstate->type_stack.insert (pstate->gdbarch (),
                                              copy_name ($2.stoken).c_str ());
                }
        ;
index fc12e5ed3a1e83d003aed9819036074b1e783678..b9266b83f29ed960979e2c72af9ef0b5b728a192 100644 (file)
@@ -20,7 +20,6 @@
 #include "type-stack.h"
 
 #include "gdbtypes.h"
-#include "parser-defs.h"
 
 /* See type-stack.h.  */
 
@@ -51,7 +50,7 @@ type_stack::insert (enum type_pieces tp)
 /* See type-stack.h.  */
 
 void
-type_stack::insert (struct expr_builder *pstate, const char *string)
+type_stack::insert (struct gdbarch *gdbarch, const char *string)
 {
   union type_stack_elt element;
   int slot;
@@ -67,8 +66,7 @@ type_stack::insert (struct expr_builder *pstate, const char *string)
   element.piece = tp_space_identifier;
   insert_into (slot, element);
   element.int_val
-    = address_space_name_to_type_instance_flags (pstate->gdbarch (),
-                                                string);
+    = address_space_name_to_type_instance_flags (gdbarch, string);
   insert_into (slot, element);
 }
 
index f94e5262fb46c052d0bbd58ce63a3e407014264f..eeb2f358bde1eb21f3b4a4a4a7d371b2e49d1fdb 100644 (file)
@@ -212,7 +212,7 @@ public:
      stack is a tp_pointer, and the new values are inserted above the
      first item.  */
 
-  void insert (struct expr_builder *pstate, const char *string);
+  void insert (struct gdbarch *gdbarch, const char *string);
 
   /* Append the elements of the type stack FROM to the type stack
      THIS.  Always returns THIS.  */