]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
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 7339ee8cb701d225284f8480a71717a171fd6979..242c668bb3d71fb244df47be75736f2491022dd9 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 17963f089e368eeee8dd2c25e8d2917cc3f34fd3..c61e18e925cbb7b13b6202557b6d357ecd17127c 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 b475491ad64e0296e51f7572229141f04101a5c1..d35920cf83c542dd7d4a5a7c1b3ffcc84152714f 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 cae3419e9a61b7c4e5720bbefe68a3b5c2507ad9..62348b1eb54d04d28d09e2219275b1a50faf036e 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 3f2a127089bc17fb853f1c49426d7285e6f2d62b..76f62b506e34567726aaac7ee52c36b104d66ebf 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 ab431c64b7daef73f623974d1cf571de2a329908..c49f7b63eb696b4d6033cd48fdbedaab015008b4 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 ee33d77365ab5fd27c21f9c5cf2bfa463785e58d..8e44b7c5f2d6707a8c0fea61bac0d711aa42f4b4 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 bd1a0ab2fe0b1ee09592d309618c0e1563d29bd7..14a1f081efc6e9de9f4ddb613cc070006199416d 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 2929b896e182f68dc994689bff9003d970812975..5b73c92df37c1d8ca310fced5472cfb04182bef3 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 b960aa38bffdbfc36f0374e5faa934b613e8ebda..d673e77629d4bc6658b9b9cdd25b6c264ac33b74 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 78b5863bd4600503034151aed118f429497c3a88..45b0750d35a56bc7af45f2414e39595fee3f9804 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 5d880596968dd9b681971b2c9bf151dded5d45a0..dc70e2c9d057f3cb853563a87eb6ae325f98a73e 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 0aa6f20e532afff4a76afc8aa8edb2450d87cd30..f128fcb2f6cde3a03bc183687ea64a915346c9ae 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 27947e79ffbb75122564448b654162b90515969a..7a6c1ee9432f8e09450af8eb204e81236e9f1c1b 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 29a3500fdf2611dccec54ef4abb12f317e5280df..6d5ff8583df32284fd38ae444d4d8abcfec14d37 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 4313170e606fdf064092d03a9f53d9743ae666ee..a1a7a1dd3c755088b2bcb0c7d29a0caa9fc3d33d 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 ed164f7d23db7b21353912a4ca428713cb7d3010..01ddb91f6eb524e71e368df3b12a851a93f0e6b3 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 f97901d608e73540a9a089021aa893b645adf107..06501779efc9ff8dfa082c6c0d928244d4f8c78e 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 c09e4fd0fc32768c2040b2b42560571bd570c870..4b84eba886d9f04afb930fb2f35060ffc5fecb92 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"));
     }