Rename address_space_int_to_name/address_space_name_to_int
authorPedro Alves <pedro@palves.net>
Mon, 14 Sep 2020 20:16:57 +0000 (21:16 +0100)
committerPedro Alves <pedro@palves.net>
Mon, 14 Sep 2020 21:19:02 +0000 (22:19 +0100)
These methods now take/return a type_instance_flags instead of a raw
integer, so rename them accordingly.

gdb/ChangeLog:

* c-typeprint.c (c_type_print_modifier): Adjust to rename.
* gdbtypes.c (address_space_name_to_int): Rename to ...
(address_space_name_to_type_instance_flags): ... this.
(address_space_int_to_name): Rename to ...
(address_space_type_instance_flags_to_name): ... this.
* gdbtypes.h (address_space_name_to_int): Rename to ...
(address_space_name_to_type_instance_flags): ... this.
(address_space_int_to_name): Rename to ...
(address_space_type_instance_flags_to_name): ... this.
* type-stack.c (type_stack::insert): Adjust to rename.
* type-stack.h (type_stack::insert): Likewise.

gdb/ChangeLog
gdb/c-typeprint.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/type-stack.c
gdb/type-stack.h

index 7d4800b0b02689829c7c9cfab14ffd1786711313..cb435c1fd78a964f7382ae2c697224c80abe173c 100644 (file)
@@ -1,3 +1,17 @@
+2020-09-14  Pedro Alves  <pedro@palves.net>
+
+       * c-typeprint.c (c_type_print_modifier): Adjust to rename.
+       * gdbtypes.c (address_space_name_to_int): Rename to ...
+       (address_space_name_to_type_instance_flags): ... this.
+       (address_space_int_to_name): Rename to ...
+       (address_space_type_instance_flags_to_name): ... this.
+       * gdbtypes.h (address_space_name_to_int): Rename to ...
+       (address_space_name_to_type_instance_flags): ... this.
+       (address_space_int_to_name): Rename to ...
+       (address_space_type_instance_flags_to_name): ... this.
+       * type-stack.c (type_stack::insert): Adjust to rename.
+       * type-stack.h (type_stack::insert): Likewise.
+
 2020-09-14  Pedro Alves  <pedro@palves.net>
            Andrew Burgess  <andrew.burgess@embecosm.com>
 
index b642c881787e9d7da5229ffdaca1545885bcdece..a07b29a95de856c93889db530733f8e9e6f8a4f6 100644 (file)
@@ -526,8 +526,9 @@ c_type_print_modifier (struct type *type, struct ui_file *stream,
       did_print_modifier = 1;
     }
 
-  address_space_id = address_space_int_to_name (get_type_arch (type),
-                                               TYPE_INSTANCE_FLAGS (type));
+  address_space_id
+    = address_space_type_instance_flags_to_name (get_type_arch (type),
+                                                TYPE_INSTANCE_FLAGS (type));
   if (address_space_id)
     {
       if (did_print_modifier || need_pre_space)
index b57353dec3051b6c2cbdc93e88e0cff323c02804..7ade2ccb533b95880fcbe3bb256f31a8fdb5b985 100644 (file)
@@ -575,12 +575,12 @@ lookup_function_type_with_arguments (struct type *type,
   return fn;
 }
 
-/* Identify address space identifier by name --
-   return the integer flag defined in gdbtypes.h.  */
+/* Identify address space identifier by name -- return a
+   type_instance_flags.  */
 
 type_instance_flags
-address_space_name_to_int (struct gdbarch *gdbarch,
-                          const char *space_identifier)
+address_space_name_to_type_instance_flags (struct gdbarch *gdbarch,
+                                          const char *space_identifier)
 {
   type_instance_flags type_flags;
 
@@ -598,12 +598,12 @@ address_space_name_to_int (struct gdbarch *gdbarch,
     error (_("Unknown address space specifier: \"%s\""), space_identifier);
 }
 
-/* Identify address space identifier by integer flag as defined in 
-   gdbtypes.h -- return the string version of the adress space name.  */
+/* Identify address space identifier by type_instance_flags and return
+   the string version of the adress space name.  */
 
 const char *
-address_space_int_to_name (struct gdbarch *gdbarch,
-                          type_instance_flags space_flag)
+address_space_type_instance_flags_to_name (struct gdbarch *gdbarch,
+                                          type_instance_flags space_flag)
 {
   if (space_flag & TYPE_INSTANCE_FLAG_CODE_SPACE)
     return "code";
index cdd136ef52524c48efae2fa63bcbfa6151d7532f..6b87de307bde8e06c119a8b5d96cf2510930a571 100644 (file)
@@ -2217,11 +2217,11 @@ extern struct type *make_atomic_type (struct type *);
 
 extern void replace_type (struct type *, struct type *);
 
-extern type_instance_flags address_space_name_to_int (struct gdbarch *,
-                                                     const char *);
+extern type_instance_flags address_space_name_to_type_instance_flags
+  (struct gdbarch *, const char *);
 
-extern const char *address_space_int_to_name (struct gdbarch *,
-                                             type_instance_flags);
+extern const char *address_space_type_instance_flags_to_name
+  (struct gdbarch *, type_instance_flags);
 
 extern struct type *make_type_with_address_space
   (struct type *type, type_instance_flags space_identifier);
index 608142c849460d10d9999b882cf22a0feb02b1f3..94ff9ba8c91242782c1523eb7d144e597ba08d55 100644 (file)
@@ -67,8 +67,9 @@ 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_int (pstate->gdbarch (),
-                                              string);
+  element.int_val
+    = address_space_name_to_type_instance_flags (pstate->gdbarch (),
+                                                string);
   insert_into (slot, element);
 }
 
index 8060f2fea7827e4b839b439e23f62ebf332ef4d6..265178fc3723daf74ee2b35a0c36beafcd363684 100644 (file)
@@ -157,11 +157,11 @@ public:
 
   /* Insert a tp_space_identifier and the corresponding address space
      value into the stack.  STRING is the name of an address space, as
-     recognized by address_space_name_to_int.  If the stack is empty,
-     the new elements are simply pushed.  If the stack is not empty,
-     this function assumes that the first item on the stack is a
-     tp_pointer, and the new values are inserted above the first
-     item.  */
+     recognized by address_space_name_to_type_instance_flags.  If the
+     stack is empty, the new elements are simply pushed.  If the stack
+     is not empty, this function assumes that the first item on the
+     stack is a tp_pointer, and the new values are inserted above the
+     first item.  */
 
   void insert (struct expr_builder *pstate, const char *string);