]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove TYPE_DECLARED_CLASS
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 2 Apr 2021 01:10:09 +0000 (21:10 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 2 Apr 2021 01:10:09 +0000 (21:10 -0400)
gdb/ChangeLog:

* gdbtypes.h (TYPE_DECLARED_CLASS): Remove, replace all uses
with type::is_declared_class.

Change-Id: Ifecb2342417ecd7bf570c3205344b09d706daab2

gdb/ChangeLog
gdb/c-exp.y
gdb/c-typeprint.c
gdb/compile/compile-cplus-types.c
gdb/d-exp.y
gdb/dwarf2/read.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/valops.c

index 77395fb796f7ecb176a69ca55bea6b1b1febeea3..72403915370047ae4a9846f13577aee9a0765141 100644 (file)
@@ -1,3 +1,8 @@
+2021-04-01  Simon Marchi  <simon.marchi@efficios.com>
+
+       * gdbtypes.h (TYPE_DECLARED_CLASS): Remove, replace all uses
+       with type::is_declared_class.
+
 2021-04-01  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbtypes.h (struct type) <is_declared_class,
index c0e4b494f3d23da1a5012525eca129f38d01726c..d6a2322dbf6e4810f1ccda88f912d6e20434e6ae 100644 (file)
@@ -1879,7 +1879,7 @@ type_aggregate_p (struct type *type)
          || type->code () == TYPE_CODE_UNION
          || type->code () == TYPE_CODE_NAMESPACE
          || (type->code () == TYPE_CODE_ENUM
-             && TYPE_DECLARED_CLASS (type)));
+             && type->is_declared_class ()));
 }
 
 /* Validate a parameter typelist.  */
index b861aafbdc9b6a2a93eed9235c4219402d2e20a3..f81f1c2c1131b32c8ba33d0298ae894117b35497 100644 (file)
@@ -965,7 +965,7 @@ output_access_specifier (struct ui_file *stream,
 static bool
 need_access_label_p (struct type *type)
 {
-  if (TYPE_DECLARED_CLASS (type))
+  if (type->is_declared_class ())
     {
       QUIT;
       for (int i = TYPE_N_BASECLASSES (type); i < type->num_fields (); i++)
@@ -1061,7 +1061,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
   c_type_print_modifier (type, stream, 0, 1, language);
   if (type->code () == TYPE_CODE_UNION)
     fprintf_filtered (stream, "union ");
-  else if (TYPE_DECLARED_CLASS (type))
+  else if (type->is_declared_class ())
     fprintf_filtered (stream, "class ");
   else
     fprintf_filtered (stream, "struct ");
@@ -1499,7 +1499,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
            fprintf_filtered (stream, "union ");
          else if (type->code () == TYPE_CODE_STRUCT)
            {
-             if (TYPE_DECLARED_CLASS (type))
+             if (type->is_declared_class ())
                fprintf_filtered (stream, "class ");
              else
                fprintf_filtered (stream, "struct ");
@@ -1552,7 +1552,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
     case TYPE_CODE_ENUM:
       c_type_print_modifier (type, stream, 0, 1, language);
       fprintf_filtered (stream, "enum ");
-      if (TYPE_DECLARED_CLASS (type))
+      if (type->is_declared_class ())
        fprintf_filtered (stream, "class ");
       /* Print the tag name if it exists.
         The aCC compiler emits a spurious 
index ef5fbcf133a107c5b9c83c7080f98fe0e50f94fc..71ad6791e1df4c968d6c0390c09c6a358ee59d32 100644 (file)
@@ -91,7 +91,7 @@ get_method_access_flag (const struct type *type, int fni, int num)
   gdb_assert (type->code () == TYPE_CODE_STRUCT);
 
   /* If this type was not declared a class, everything is public.  */
-  if (!TYPE_DECLARED_CLASS (type))
+  if (!type->is_declared_class ())
     return GCC_CP_ACCESS_PUBLIC;
 
   /* Otherwise, read accessibility from the fn_field.  */
@@ -828,11 +828,11 @@ compile_cplus_convert_struct_or_union (compile_cplus_instance *instance,
   gcc_decl resuld;
   if (type->code () == TYPE_CODE_STRUCT)
     {
-      const char *what = TYPE_DECLARED_CLASS (type) ? "class" : "struct";
+      const char *what = type->is_declared_class () ? "class" : "struct";
 
       resuld = instance->plugin ().build_decl
        (what, name.get (), (GCC_CP_SYMBOL_CLASS | nested_access
-                            | (TYPE_DECLARED_CLASS (type)
+                            | (type->is_declared_class ()
                                ? GCC_CP_FLAG_CLASS_NOFLAG
                                : GCC_CP_FLAG_CLASS_IS_STRUCT)),
         0, nullptr, 0, filename, line);
index 90c342e0e218e8e3b385abfdf41dddf4f5e21db8..20884baebbadfdf11e27c0ea7f5ac633b686e120 100644 (file)
@@ -640,7 +640,7 @@ type_aggregate_p (struct type *type)
          || type->code () == TYPE_CODE_UNION
          || type->code () == TYPE_CODE_MODULE
          || (type->code () == TYPE_CODE_ENUM
-             && TYPE_DECLARED_CLASS (type)));
+             && type->is_declared_class ()));
 }
 
 /* Take care of parsing a number (anything that starts with a digit).
index 9a90d992cc9d5f6e802f03f6b140ed607305f555..165a8090f994dd477ea805b4ffa4f8d94da03f33 100644 (file)
@@ -23307,7 +23307,7 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
        return determine_prefix (parent, cu);
       case DW_TAG_enumeration_type:
        parent_type = read_type_die (parent, cu);
-       if (TYPE_DECLARED_CLASS (parent_type))
+       if (parent_type->is_declared_class ())
          {
            if (parent_type->name () != NULL)
              return parent_type->name ();
index 1b2d4836959edff40130233cb26ff0ff90108f4c..5a20e7e16ca1da0ed7fa06a1ea40f37fc74aded7 100644 (file)
@@ -4507,7 +4507,7 @@ rank_one_type_parm_int (struct type *parm, struct type *arg, struct value *value
     case TYPE_CODE_CHAR:
     case TYPE_CODE_RANGE:
     case TYPE_CODE_BOOL:
-      if (TYPE_DECLARED_CLASS (arg))
+      if (arg->is_declared_class ())
        return INCOMPATIBLE_TYPE_BADNESS;
       return INTEGER_PROMOTION_BADNESS;
     case TYPE_CODE_FLT:
@@ -4531,7 +4531,7 @@ rank_one_type_parm_enum (struct type *parm, struct type *arg, struct value *valu
     case TYPE_CODE_RANGE:
     case TYPE_CODE_BOOL:
     case TYPE_CODE_ENUM:
-      if (TYPE_DECLARED_CLASS (parm) || TYPE_DECLARED_CLASS (arg))
+      if (parm->is_declared_class () || arg->is_declared_class ())
        return INCOMPATIBLE_TYPE_BADNESS;
       return INTEGER_CONVERSION_BADNESS;
     case TYPE_CODE_FLT:
@@ -4551,7 +4551,7 @@ rank_one_type_parm_char (struct type *parm, struct type *arg, struct value *valu
     case TYPE_CODE_RANGE:
     case TYPE_CODE_BOOL:
     case TYPE_CODE_ENUM:
-      if (TYPE_DECLARED_CLASS (arg))
+      if (arg->is_declared_class ())
        return INCOMPATIBLE_TYPE_BADNESS;
       return INTEGER_CONVERSION_BADNESS;
     case TYPE_CODE_FLT:
index 7444e7ad23941142ae884e7aa199ef2436282a2f..9677d068ee1cf87365ca5d9d9d8f1f7b7e0527a1 100644 (file)
@@ -220,14 +220,6 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags);
 
 #define TYPE_NOTTEXT(t)        (((t)->instance_flags ()) & TYPE_INSTANCE_FLAG_NOTTEXT)
 
-/* * True if this type was declared using the "class" keyword.  This is
-   only valid for C++ structure and enum types.  If false, a structure
-   was declared as a "struct"; if true it was declared "class".  For
-   enum types, this is true when "enum class" or "enum struct" was
-   used to declare the type..  */
-
-#define TYPE_DECLARED_CLASS(t) ((t)->declared_class ())
-
 /* * True if this type is a "flag" enum.  A flag enum is one where all
    the values are pairwise disjoint when "and"ed together.  This
    affects how enum values are printed.  */
index f86c98180584b830a4877de27ecdcc6c5203519e..b65401c079f1eeb3ac6cde651e49fcb2ea77271f 100644 (file)
@@ -3313,7 +3313,7 @@ enum_constant_from_type (struct type *type, const char *name)
   int name_len = strlen (name);
 
   gdb_assert (type->code () == TYPE_CODE_ENUM
-             && TYPE_DECLARED_CLASS (type));
+             && type->is_declared_class ());
 
   for (i = TYPE_N_BASECLASSES (type); i < type->num_fields (); ++i)
     {