Delete TYPE_CODE_CLASS, it's just an alias of TYPE_CODE_STRUCT.
authorDoug Evans <xdje42@gmail.com>
Fri, 7 Nov 2014 01:19:06 +0000 (17:19 -0800)
committerDoug Evans <xdje42@gmail.com>
Fri, 7 Nov 2014 01:19:06 +0000 (17:19 -0800)
gdb/ChangeLog:

* gdbtypes.h (TYPE_CODE_CLASS): Delete.  All uses changed to use
TYPE_CODE_STRUCT.

19 files changed:
gdb/c-exp.y
gdb/c-valprint.c
gdb/cp-support.c
gdb/d-exp.y
gdb/dwarf2read.c
gdb/eval.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/gnu-v2-abi.c
gdb/gnu-v3-abi.c
gdb/guile/scm-type.c
gdb/guile/scm-value.c
gdb/p-exp.y
gdb/parse.c
gdb/python/py-type.c
gdb/python/py-value.c
gdb/symtab.c
gdb/typeprint.c
gdb/valops.c

index 7339ee8..242c668 100644 (file)
@@ -1353,12 +1353,12 @@ typebase  /* Implements (approximately): (type-qualifier)* type-specifier */
                                              expression_context_block); }
        |       CLASS COMPLETE
                        {
-                         mark_completion_tag (TYPE_CODE_CLASS, "", 0);
+                         mark_completion_tag (TYPE_CODE_STRUCT, "", 0);
                          $$ = NULL;
                        }
        |       CLASS name COMPLETE
                        {
-                         mark_completion_tag (TYPE_CODE_CLASS, $2.ptr,
+                         mark_completion_tag (TYPE_CODE_STRUCT, $2.ptr,
                                               $2.length);
                          $$ = NULL;
                        }
index 17963f0..c61e18e 100644 (file)
@@ -495,7 +495,7 @@ c_value_print (struct value *val, struct ui_file *stream,
          /* Print nothing.  */
        }
       else if (options->objectprint
-              && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+              && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
        {
          int is_ref = TYPE_CODE (type) == TYPE_CODE_REF;
 
@@ -545,7 +545,7 @@ c_value_print (struct value *val, struct ui_file *stream,
   if (!value_initialized (val))
     fprintf_filtered (stream, " [uninitialized] ");
 
-  if (options->objectprint && (TYPE_CODE (type) == TYPE_CODE_CLASS))
+  if (options->objectprint && (TYPE_CODE (type) == TYPE_CODE_STRUCT))
     {
       /* Attempt to determine real type of object.  */
       real_type = value_rtti_type (val, &full, &top, &using_enc);
index b475491..d35920c 100644 (file)
@@ -1297,7 +1297,7 @@ make_symbol_overload_list_adl_namespace (struct type *type,
     }
 
   /* Check public base type */
-  if (TYPE_CODE (type) == TYPE_CODE_CLASS)
+  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
     for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
       {
        if (BASETYPE_VIA_PUBLIC (type, i))
@@ -1463,7 +1463,7 @@ cp_lookup_rtti_type (const char *name, struct block *block)
 
   switch (TYPE_CODE (rtti_type))
     {
-    case TYPE_CODE_CLASS:
+    case TYPE_CODE_STRUCT:
       break;
     case TYPE_CODE_NAMESPACE:
       /* chastain/2003-11-26: the symbol tables often contain fake
index cae3419..62348b1 100644 (file)
@@ -605,10 +605,10 @@ BasicType:
                { $$ = lookup_struct (copy_name ($2),
                                      expression_context_block); }
 |      CLASS_KEYWORD COMPLETE
-               { mark_completion_tag (TYPE_CODE_CLASS, "", 0);
+               { mark_completion_tag (TYPE_CODE_STRUCT, "", 0);
                  $$ = NULL; }
 |      CLASS_KEYWORD IdentifierExp COMPLETE
-               { mark_completion_tag (TYPE_CODE_CLASS, $2.ptr, $2.length);
+               { mark_completion_tag (TYPE_CODE_STRUCT, $2.ptr, $2.length);
                  $$ = NULL; }
 |      STRUCT_KEYWORD IdentifierExp
                { $$ = lookup_struct (copy_name ($2),
index 3f2a127..76f62b5 100644 (file)
@@ -12965,7 +12965,7 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu)
     }
   else
     {
-      TYPE_CODE (type) = TYPE_CODE_CLASS;
+      TYPE_CODE (type) = TYPE_CODE_STRUCT;
     }
 
   if (cu->language == language_cplus && die->tag == DW_TAG_class_type)
index ab431c6..c49f7b6 100644 (file)
@@ -1870,7 +1870,7 @@ evaluate_subexp_standard (struct type *expect_type,
 
        get_user_print_options (&opts);
         if (opts.objectprint && TYPE_TARGET_TYPE(type)
-            && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+            && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
           {
             real_type = value_rtti_indirect_type (arg1, &full, &top,
                                                  &using_enc);
index ee33d77..8e44b7c 100644 (file)
@@ -3414,7 +3414,6 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
        }
       break;
     case TYPE_CODE_STRUCT:
-      /* currently same as TYPE_CODE_CLASS.  */
       switch (TYPE_CODE (arg))
        {
        case TYPE_CODE_STRUCT:
index bd1a0ab..14a1f08 100644 (file)
@@ -184,15 +184,6 @@ enum type_code
     TYPE_CODE_XMETHOD
   };
 
-/* * For now allow source to use TYPE_CODE_CLASS for C++ classes, as
-   an alias for TYPE_CODE_STRUCT.  This is for DWARF, which has a
-   distinct "class" attribute.  Perhaps we should actually have a
-   separate TYPE_CODE so that we can print "class" or "struct"
-   depending on what the debug info said.  It's not clear we should
-   bother.  */
-
-#define TYPE_CODE_CLASS TYPE_CODE_STRUCT
-
 /* * Some constants representing each bit field in the main_type.  See
    the bit-field-specific macros, below, for documentation of each
    constant in this enum.  These enum values are only used with
index 2929b89..5b73c92 100644 (file)
@@ -206,7 +206,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
   known_type = value_type (v);
   CHECK_TYPEDEF (known_type);
   /* RTTI works only or class objects.  */
-  if (TYPE_CODE (known_type) != TYPE_CODE_CLASS)
+  if (TYPE_CODE (known_type) != TYPE_CODE_STRUCT)
     return NULL;
 
   /* Plan on this changing in the future as i get around to setting
index b960aa3..d673e77 100644 (file)
@@ -288,7 +288,7 @@ gnuv3_rtti_type (struct value *value,
   char *atsign;
 
   /* We only have RTTI for class objects.  */
-  if (TYPE_CODE (values_type) != TYPE_CODE_CLASS)
+  if (TYPE_CODE (values_type) != TYPE_CODE_STRUCT)
     return NULL;
 
   /* Java doesn't have RTTI following the C++ ABI.  */
@@ -406,7 +406,7 @@ gnuv3_virtual_fn_field (struct value **value_p,
   struct gdbarch *gdbarch;
 
   /* Some simple sanity checks.  */
-  if (TYPE_CODE (values_type) != TYPE_CODE_CLASS)
+  if (TYPE_CODE (values_type) != TYPE_CODE_STRUCT)
     error (_("Only classes can have virtual functions."));
 
   /* Determine architecture.  */
@@ -1101,7 +1101,7 @@ gnuv3_get_typeid (struct value *value)
 
   /* We check for lval_memory because in the "typeid (type-id)" case,
      the type is passed via a not_lval value object.  */
-  if (TYPE_CODE (type) == TYPE_CODE_CLASS
+  if (TYPE_CODE (type) == TYPE_CODE_STRUCT
       && value_lval_const (value) == lval_memory
       && gnuv3_dynamic_class (type))
     {
@@ -1277,7 +1277,6 @@ gnuv3_pass_by_reference (struct type *type)
 
   /* We're only interested in things that can have methods.  */
   if (TYPE_CODE (type) != TYPE_CODE_STRUCT
-      && TYPE_CODE (type) != TYPE_CODE_CLASS
       && TYPE_CODE (type) != TYPE_CODE_UNION)
     return 0;
 
index 78b5863..45b0750 100644 (file)
@@ -1199,7 +1199,7 @@ gdbscm_field_baseclass_p (SCM self)
   struct field *field = tyscm_field_smob_to_field (f_smob);
   struct type *type = tyscm_field_smob_containing_type (f_smob);
 
-  if (TYPE_CODE (type) == TYPE_CODE_CLASS)
+  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
     return scm_from_bool (f_smob->field_num < TYPE_N_BASECLASSES (type));
   return SCM_BOOL_F;
 }
index 5d88059..dc70e2c 100644 (file)
@@ -565,7 +565,7 @@ gdbscm_value_dynamic_type (SCM self)
 
       if (((TYPE_CODE (type) == TYPE_CODE_PTR)
           || (TYPE_CODE (type) == TYPE_CODE_REF))
-         && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+         && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
        {
          struct value *target;
          int was_pointer = TYPE_CODE (type) == TYPE_CODE_PTR;
@@ -584,7 +584,7 @@ gdbscm_value_dynamic_type (SCM self)
                type = lookup_reference_type (type);
            }
        }
-      else if (TYPE_CODE (type) == TYPE_CODE_CLASS)
+      else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
        type = value_rtti_type (value, NULL, NULL, NULL);
       else
        {
index 0aa6f20..f128fcb 100644 (file)
@@ -410,8 +410,8 @@ exp :       type '(' exp ')' %prec UNARY
                            {
                              /* Allow automatic dereference of classes.  */
                              if ((TYPE_CODE (current_type) == TYPE_CODE_PTR)
-                                 && (TYPE_CODE (TYPE_TARGET_TYPE (current_type)) == TYPE_CODE_CLASS)
-                                 && (TYPE_CODE ($1) == TYPE_CODE_CLASS))
+                                 && (TYPE_CODE (TYPE_TARGET_TYPE (current_type)) == TYPE_CODE_STRUCT)
+                                 && (TYPE_CODE ($1) == TYPE_CODE_STRUCT))
                                write_exp_elt_opcode (pstate, UNOP_IND);
                            }
                          write_exp_elt_opcode (pstate, UNOP_CAST);
index 27947e7..7a6c1ee 100644 (file)
@@ -583,7 +583,6 @@ mark_completion_tag (enum type_code tag, const char *ptr, int length)
              && expout_last_struct == -1);
   gdb_assert (tag == TYPE_CODE_UNION
              || tag == TYPE_CODE_STRUCT
-             || tag == TYPE_CODE_CLASS
              || tag == TYPE_CODE_ENUM);
   expout_tag_completion_type = tag;
   expout_completion_name = xmalloc (length + 1);
index 29a3500..6d5ff85 100644 (file)
@@ -232,7 +232,7 @@ convert_field (struct type *type, int field)
     goto failarg;
   Py_DECREF (arg);
 
-  if (TYPE_CODE (type) == TYPE_CODE_CLASS)
+  if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
     arg = field < TYPE_N_BASECLASSES (type) ? Py_True : Py_False;
   else
     arg = Py_False;
index 4313170..a1a7a1d 100644 (file)
@@ -302,7 +302,7 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
 
       if (((TYPE_CODE (type) == TYPE_CODE_PTR)
           || (TYPE_CODE (type) == TYPE_CODE_REF))
-         && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+         && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
        {
          struct value *target;
          int was_pointer = TYPE_CODE (type) == TYPE_CODE_PTR;
@@ -321,7 +321,7 @@ valpy_get_dynamic_type (PyObject *self, void *closure)
                type = lookup_reference_type (type);
            }
        }
-      else if (TYPE_CODE (type) == TYPE_CODE_CLASS)
+      else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
        type = value_rtti_type (val, NULL, NULL, NULL);
       else
        {
index ed164f7..01ddb91 100644 (file)
@@ -4720,7 +4720,6 @@ make_symbol_completion_type (const char *text, const char *word,
 {
   gdb_assert (code == TYPE_CODE_UNION
              || code == TYPE_CODE_STRUCT
-             || code == TYPE_CODE_CLASS
              || code == TYPE_CODE_ENUM);
   return current_language->la_make_symbol_completion_list (text, word, code);
 }
index f97901d..0650177 100644 (file)
@@ -461,9 +461,9 @@ whatis_exp (char *exp, int show)
     {
       if (((TYPE_CODE (type) == TYPE_CODE_PTR)
           || (TYPE_CODE (type) == TYPE_CODE_REF))
-         && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+         && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
         real_type = value_rtti_indirect_type (val, &full, &top, &using_enc);
-      else if (TYPE_CODE (type) == TYPE_CODE_CLASS)
+      else if (TYPE_CODE (type) == TYPE_CODE_STRUCT)
        real_type = value_rtti_type (val, &full, &top, &using_enc);
     }
 
index c09e4fd..4b84eba 100644 (file)
@@ -735,7 +735,7 @@ value_dynamic_cast (struct type *type, struct value *arg)
       && TYPE_CODE (resolved_type) != TYPE_CODE_REF)
     error (_("Argument to dynamic_cast must be a pointer or reference type"));
   if (TYPE_CODE (TYPE_TARGET_TYPE (resolved_type)) != TYPE_CODE_VOID
-      && TYPE_CODE (TYPE_TARGET_TYPE (resolved_type)) != TYPE_CODE_CLASS)
+      && TYPE_CODE (TYPE_TARGET_TYPE (resolved_type)) != TYPE_CODE_STRUCT)
     error (_("Argument to dynamic_cast must be pointer to class or `void *'"));
 
   class_type = check_typedef (TYPE_TARGET_TYPE (resolved_type));
@@ -748,7 +748,7 @@ value_dynamic_cast (struct type *type, struct value *arg)
       if (TYPE_CODE (arg_type) == TYPE_CODE_PTR)
        {
          arg_type = check_typedef (TYPE_TARGET_TYPE (arg_type));
-         if (TYPE_CODE (arg_type) != TYPE_CODE_CLASS)
+         if (TYPE_CODE (arg_type) != TYPE_CODE_STRUCT)
            error (_("Argument to dynamic_cast does "
                     "not have pointer to class type"));
        }
@@ -761,7 +761,7 @@ value_dynamic_cast (struct type *type, struct value *arg)
     }
   else
     {
-      if (TYPE_CODE (arg_type) != TYPE_CODE_CLASS)
+      if (TYPE_CODE (arg_type) != TYPE_CODE_STRUCT)
        error (_("Argument to dynamic_cast does not have class type"));
     }