[3/5] Remove struct main_type.vptr_{fieldno,basetype}: Rename TYPE_DOMAIN_TYPE

Message ID m3wq4a8wke.fsf@sspiff.org
State New, archived
Headers

Commit Message

Doug Evans Jan. 25, 2015, 7:55 p.m. UTC
  Hi.

This patch is just a simple global renaming of TYPE_DOMAIN_TYPE
to TYPE_SELF_TYPE.

2015-01-24  Doug Evans  <xdje42@gmail.com>

	* gdbtypes.h (TYPE_SELF_TYPE): Renamed from TYPE_DOMAIN_TYPE.
	All uses updated.
  

Patch

diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index c94534e..5a1b25f 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -315,11 +315,11 @@  c_type_print_varspec_prefix (struct type *type,
     case TYPE_CODE_MEMBERPTR:
       c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
 				   stream, show, 0, 0, flags);
-      name = type_name_no_tag (TYPE_DOMAIN_TYPE (type));
+      name = type_name_no_tag (TYPE_SELF_TYPE (type));
       if (name)
 	print_name_maybe_canonical (name, flags, stream);
       else
-	c_type_print_base (TYPE_DOMAIN_TYPE (type),
+	c_type_print_base (TYPE_SELF_TYPE (type),
 			   stream, -1, passed_a_ptr, flags);
       fprintf_filtered (stream, "::*");
       break;
@@ -328,11 +328,11 @@  c_type_print_varspec_prefix (struct type *type,
       c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
 				   stream, show, 0, 0, flags);
       fprintf_filtered (stream, "(");
-      name = type_name_no_tag (TYPE_DOMAIN_TYPE (type));
+      name = type_name_no_tag (TYPE_SELF_TYPE (type));
       if (name)
 	print_name_maybe_canonical (name, flags, stream);
       else
-	c_type_print_base (TYPE_DOMAIN_TYPE (type),
+	c_type_print_base (TYPE_SELF_TYPE (type),
 			   stream, -1, passed_a_ptr, flags);
       fprintf_filtered (stream, "::*");
       break;
diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
index bf1a600..9eea7ce 100644
--- a/gdb/cp-valprint.c
+++ b/gdb/cp-valprint.c
@@ -764,7 +764,7 @@  cp_print_class_member (const gdb_byte *valaddr, struct type *type,
   /* VAL is a byte offset into the structure type DOMAIN.
      Find the name of the field for that offset and
      print it.  */
-  struct type *domain = TYPE_DOMAIN_TYPE (type);
+  struct type *domain = TYPE_SELF_TYPE (type);
   LONGEST val;
   int fieldno;
 
diff --git a/gdb/eval.c b/gdb/eval.c
index 72ac69f..e6ab662 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1390,7 +1390,7 @@  evaluate_subexp_standard (struct type *expect_type,
 	  else if (TYPE_CODE (type) == TYPE_CODE_MEMBERPTR)
 	    {
 	      struct type *type_ptr
-		= lookup_pointer_type (TYPE_DOMAIN_TYPE (type));
+		= lookup_pointer_type (TYPE_SELF_TYPE (type));
 	      struct type *target_type_ptr
 		= lookup_pointer_type (TYPE_TARGET_TYPE (type));
 
@@ -1934,7 +1934,7 @@  evaluate_subexp_standard (struct type *expect_type,
 
 	case TYPE_CODE_MEMBERPTR:
 	  /* Now, convert these values to an address.  */
-	  arg1 = value_cast_pointers (lookup_pointer_type (TYPE_DOMAIN_TYPE (type)),
+	  arg1 = value_cast_pointers (lookup_pointer_type (TYPE_SELF_TYPE (type)),
 				      arg1, 1);
 
 	  mem_offset = value_as_long (arg2);
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 1875958..5813103 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -805,7 +805,7 @@  allocate_stub_method (struct type *type)
   TYPE_LENGTH (mtype) = 1;
   TYPE_STUB (mtype) = 1;
   TYPE_TARGET_TYPE (mtype) = type;
-  /*  _DOMAIN_TYPE (mtype) = unknown yet */
+  /* TYPE_SELF_TYPE (mtype) = unknown yet */
   return mtype;
 }
 
@@ -1205,7 +1205,7 @@  smash_to_memberptr_type (struct type *type, struct type *domain,
 {
   smash_type (type);
   TYPE_TARGET_TYPE (type) = to_type;
-  TYPE_DOMAIN_TYPE (type) = domain;
+  TYPE_SELF_TYPE (type) = domain;
   /* Assume that a data member pointer is the same size as a normal
      pointer.  */
   TYPE_LENGTH (type)
@@ -1224,7 +1224,7 @@  smash_to_methodptr_type (struct type *type, struct type *to_type)
 {
   smash_type (type);
   TYPE_TARGET_TYPE (type) = to_type;
-  TYPE_DOMAIN_TYPE (type) = TYPE_DOMAIN_TYPE (to_type);
+  TYPE_SELF_TYPE (type) = TYPE_SELF_TYPE (to_type);
   TYPE_LENGTH (type) = cplus_method_ptr_size (to_type);
   TYPE_CODE (type) = TYPE_CODE_METHODPTR;
 }
@@ -1243,7 +1243,7 @@  smash_to_method_type (struct type *type, struct type *domain,
 {
   smash_type (type);
   TYPE_TARGET_TYPE (type) = to_type;
-  TYPE_DOMAIN_TYPE (type) = domain;
+  TYPE_SELF_TYPE (type) = domain;
   TYPE_FIELDS (type) = args;
   TYPE_NFIELDS (type) = nargs;
   if (varargs)
@@ -2279,7 +2279,7 @@  check_stub_method (struct type *type, int method_id, int signature_id)
 
   /* Now update the old "stub" type into a real type.  */
   mtype = TYPE_FN_FIELD_TYPE (f, signature_id);
-  TYPE_DOMAIN_TYPE (mtype) = type;
+  TYPE_SELF_TYPE (mtype) = type;
   TYPE_FIELDS (mtype) = argtypes;
   TYPE_NFIELDS (mtype) = argcount;
   TYPE_STUB (mtype) = 0;
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 3cf09c5..ef20743 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1232,7 +1232,7 @@  extern void allocate_gnat_aux_type (struct type *);
 /* C++ */
 
 #define TYPE_VPTR_BASETYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype
-#define TYPE_DOMAIN_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype
+#define TYPE_SELF_TYPE(thistype) TYPE_MAIN_TYPE(thistype)->vptr_basetype
 #define TYPE_VPTR_FIELDNO(thistype) TYPE_MAIN_TYPE(thistype)->vptr_fieldno
 #define TYPE_NFN_FIELDS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->nfn_fields
 #define TYPE_SPECIFIC_FIELD(thistype) \
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index a62599b..eddda4f 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -584,7 +584,7 @@  gnuv3_print_method_ptr (const gdb_byte *contents,
 			struct type *type,
 			struct ui_file *stream)
 {
-  struct type *domain = TYPE_DOMAIN_TYPE (type);
+  struct type *domain = TYPE_SELF_TYPE (type);
   struct gdbarch *gdbarch = get_type_arch (domain);
   CORE_ADDR ptr_value;
   LONGEST adjustment;
@@ -713,7 +713,7 @@  gnuv3_method_ptr_to_value (struct value **this_p, struct value *method_ptr)
   LONGEST adjustment;
   int vbit;
 
-  domain_type = TYPE_DOMAIN_TYPE (check_typedef (value_type (method_ptr)));
+  domain_type = TYPE_SELF_TYPE (check_typedef (value_type (method_ptr)));
   final_type = lookup_pointer_type (domain_type);
 
   method_type = TYPE_TARGET_TYPE (check_typedef (value_type (method_ptr)));
diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
index 79a2a87..4e82938 100644
--- a/gdb/m2-typeprint.c
+++ b/gdb/m2-typeprint.c
@@ -188,7 +188,7 @@  m2_range (struct type *type, struct ui_file *stream, int show,
 	  int level, const struct type_print_options *flags)
 {
   if (TYPE_HIGH_BOUND (type) == TYPE_LOW_BOUND (type))
-    m2_print_type (TYPE_DOMAIN_TYPE (type), "", stream, show, level,
+    m2_print_type (TYPE_SELF_TYPE (type), "", stream, show, level,
 		   flags);
   else
     {
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index 2398691..5a7a887 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -239,7 +239,7 @@  pascal_type_print_varspec_prefix (struct type *type, struct ui_file *stream,
       if (passed_a_ptr)
 	{
 	  fprintf_filtered (stream, " ");
-	  pascal_type_print_base (TYPE_DOMAIN_TYPE (type),
+	  pascal_type_print_base (TYPE_SELF_TYPE (type),
 				  stream, 0, passed_a_ptr, flags);
 	  fprintf_filtered (stream, "::");
 	}
diff --git a/gdb/stabsread.c b/gdb/stabsread.c
index 6862c52..1f46f75 100644
--- a/gdb/stabsread.c
+++ b/gdb/stabsread.c
@@ -2380,8 +2380,8 @@  read_member_functions (struct field_info *fip, char **pp, struct type *type,
 
 	  if (TYPE_STUB (new_sublist->fn_field.type))
 	    {
-	      if (!TYPE_DOMAIN_TYPE (new_sublist->fn_field.type))
-		TYPE_DOMAIN_TYPE (new_sublist->fn_field.type) = type;
+	      if (!TYPE_SELF_TYPE (new_sublist->fn_field.type))
+		TYPE_SELF_TYPE (new_sublist->fn_field.type) = type;
 	      new_sublist->fn_field.is_stub = 1;
 	    }
 	  new_sublist->fn_field.physname = savestring (*pp, p - *pp);
diff --git a/gdb/valops.c b/gdb/valops.c
index 8cbac85..23a4b37 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -2544,7 +2544,7 @@  find_overload_match (struct value **args, int nargs,
 	 value_find_oload_method_list above.  */
       if (fns_ptr)
 	{
-	  gdb_assert (TYPE_DOMAIN_TYPE (fns_ptr[0].type) != NULL);
+	  gdb_assert (TYPE_SELF_TYPE (fns_ptr[0].type) != NULL);
 
 	  src_method_oload_champ = find_oload_champ (args, nargs,
 						     num_fns, fns_ptr, NULL,
@@ -3360,7 +3360,7 @@  value_struct_elt_for_reference (struct type *domain, int offset,
 		  type = check_typedef (value_type (ptr));
 		  gdb_assert (type != NULL
 			      && TYPE_CODE (type) == TYPE_CODE_MEMBERPTR);
-		  tmp = lookup_pointer_type (TYPE_DOMAIN_TYPE (type));
+		  tmp = lookup_pointer_type (TYPE_SELF_TYPE (type));
 		  v = value_cast_pointers (tmp, v, 1);
 		  mem_offset = value_as_long (ptr);
 		  tmp = lookup_pointer_type (TYPE_TARGET_TYPE (type));