gdb: remove TYPE_STUB
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 14 Sep 2020 15:07:59 +0000 (11:07 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 14 Sep 2020 15:07:59 +0000 (11:07 -0400)
gdb/ChangeLog:

* gdbtypes.h (TYPE_STUB): Remove, replace all
uses with type::is_stub.

Change-Id: Iec25b50449a0d10a38f815209e478c343e98632c

13 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/ada-typeprint.c
gdb/c-typeprint.c
gdb/dwarf2/read.c
gdb/gdbtypes.c
gdb/gdbtypes.h
gdb/m2-valprint.c
gdb/p-typeprint.c
gdb/p-valprint.c
gdb/python/py-type.c
gdb/stabsread.c
gdb/valprint.c

index 1b58171e0f6c9f8168e5e6d3c6dd80a61029fda7..aac62fceb0fd79dff6bc5d02235c6409f2b39305 100644 (file)
@@ -1,3 +1,8 @@
+2020-09-14  Simon Marchi  <simon.marchi@efficios.com>
+
+       * gdbtypes.h (TYPE_STUB): Remove, replace all
+       uses with type::is_stub.
+
 2020-09-14  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbtypes.h (struct type) <is_stub, set_is_stub>: New methods.
index c126f98ed1d58c9c7207f5c5b2c9c10412039cdc..4aaf862fd8f60cbcc905498bac2233f6d22d88af 100644 (file)
@@ -1592,7 +1592,7 @@ desc_bounds (struct value *arr)
        {
          struct type *target_type = TYPE_TARGET_TYPE (p_bounds_type);
 
-         if (TYPE_STUB (target_type))
+         if (target_type->is_stub ())
            p_bounds = value_cast (lookup_pointer_type
                                   (ada_check_typedef (target_type)),
                                   p_bounds);
@@ -5010,13 +5010,13 @@ remove_extra_symbols (std::vector<struct block_symbol> *syms)
       /* If two symbols have the same name and one of them is a stub type,
          the get rid of the stub.  */
 
-      if (TYPE_STUB (SYMBOL_TYPE ((*syms)[i].symbol))
+      if (SYMBOL_TYPE ((*syms)[i].symbol)->is_stub ()
           && (*syms)[i].symbol->linkage_name () != NULL)
         {
           for (j = 0; j < syms->size (); j++)
             {
               if (j != i
-                  && !TYPE_STUB (SYMBOL_TYPE ((*syms)[j].symbol))
+                  && !SYMBOL_TYPE ((*syms)[j].symbol)->is_stub ()
                   && (*syms)[j].symbol->linkage_name () != NULL
                   && strcmp ((*syms)[i].symbol->linkage_name (),
                              (*syms)[j].symbol->linkage_name ()) == 0)
@@ -8762,7 +8762,7 @@ ada_check_typedef (struct type *type)
 
   type = check_typedef (type);
   if (type == NULL || type->code () != TYPE_CODE_ENUM
-      || !TYPE_STUB (type)
+      || !type->is_stub ()
       || type->name () == NULL)
     return type;
   else
index 062b9d8a21f7b60187c41d63dfb9df88480465b5..8ee620c36ad7cc0e0eee9f198469e23b6cf0d738 100644 (file)
@@ -623,7 +623,7 @@ print_selected_record_field_types (struct type *type, struct type *outer_type,
 
   flds = 0;
 
-  if (fld0 > fld1 && TYPE_STUB (type))
+  if (fld0 > fld1 && type->is_stub ())
     return -1;
 
   for (i = fld0; i <= fld1; i += 1)
index 91d9ef8209e8ada82e646fe4677bff2f582f9fa2..ef16f2b83e1a4732bb953104a8a0766059d510df 100644 (file)
@@ -1118,7 +1118,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
       if (type->num_fields () == 0 && TYPE_NFN_FIELDS (type) == 0
          && TYPE_TYPEDEF_FIELD_COUNT (type) == 0)
        {
-         if (TYPE_STUB (type))
+         if (type->is_stub ())
            fprintfi_filtered (level + 4, stream,
                               _("%p[<incomplete type>%p]\n"),
                               metadata_style.style ().ptr (), nullptr);
@@ -1629,7 +1629,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream,
            fprintf_filtered (stream, "{\n");
            if (type->num_fields () == 0)
              {
-               if (TYPE_STUB (type))
+               if (type->is_stub ())
                  fprintfi_filtered (level + 4, stream,
                                     _("%p[<incomplete type>%p]\n"),
                                     metadata_style.style ().ptr (), nullptr);
index f17401e922a71f079ecc71c4d6d6a863492cf1df..b93583313866dfd59ffb98041fb99d2f9091f9b5 100644 (file)
@@ -16640,7 +16640,7 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
      can tell us the reality.  However, we defer to a local size
      attribute if one exists, because this lets the compiler override
      the underlying type if needed.  */
-  if (TYPE_TARGET_TYPE (type) != NULL && !TYPE_STUB (TYPE_TARGET_TYPE (type)))
+  if (TYPE_TARGET_TYPE (type) != NULL && !TYPE_TARGET_TYPE (type)->is_stub ())
     {
       struct type *underlying_type = TYPE_TARGET_TYPE (type);
       underlying_type = check_typedef (underlying_type);
index 687cfe096b76b33e0458ff01fbb398383940db5a..492061fa0a4f96f43df9bc2d220ab95bb6000a98 100644 (file)
@@ -934,7 +934,7 @@ create_range_type (struct type *result_type, struct type *index_type,
     result_type = alloc_type_copy (index_type);
   result_type->set_code (TYPE_CODE_RANGE);
   TYPE_TARGET_TYPE (result_type) = index_type;
-  if (TYPE_STUB (index_type))
+  if (index_type->is_stub ())
     TYPE_TARGET_STUB (result_type) = 1;
   else
     TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type));
@@ -1388,7 +1388,7 @@ create_set_type (struct type *result_type, struct type *domain_type)
   result_type->set_fields
     ((struct field *) TYPE_ZALLOC (result_type, sizeof (struct field)));
 
-  if (!TYPE_STUB (domain_type))
+  if (!domain_type->is_stub ())
     {
       LONGEST low_bound, high_bound, bit_length;
 
@@ -2837,7 +2837,7 @@ check_typedef (struct type *type)
     }
   /* Otherwise, rely on the stub flag being set for opaque/stubbed
      types.  */
-  else if (TYPE_STUB (type) && !currently_reading_symtab)
+  else if (type->is_stub () && !currently_reading_symtab)
     {
       const char *name = type->name ();
       /* FIXME: shouldn't we look in STRUCT_DOMAIN and/or VAR_DOMAIN
@@ -2868,7 +2868,7 @@ check_typedef (struct type *type)
     {
       struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
 
-      if (TYPE_STUB (target_type) || TYPE_TARGET_STUB (target_type))
+      if (target_type->is_stub () || TYPE_TARGET_STUB (target_type))
        {
          /* Nothing we can do.  */
        }
@@ -5076,7 +5076,7 @@ recursive_dump_type (struct type *type, int spaces)
     {
       puts_filtered (" TYPE_ENDIANITY_NOT_DEFAULT");
     }
-  if (TYPE_STUB (type))
+  if (type->is_stub ())
     {
       puts_filtered (" TYPE_STUB");
     }
index 7739757d442cf05e717c9335ccba69ae456519d7..bceb1b876058b3a4302b0a8bdcfd14eb988aa972 100644 (file)
@@ -216,12 +216,6 @@ DEF_ENUM_FLAGS_TYPE (enum type_instance_flag_value, type_instance_flags);
 
 #define TYPE_ENDIANITY_NOT_DEFAULT(t) (TYPE_MAIN_TYPE (t)->flag_endianity_not_default)
 
-/* * This appears in a type's flags word if it is a stub type (e.g.,
-   if someone referenced a type that wasn't defined in a source file
-   via (struct sir_not_appearing_in_this_film *)).  */
-
-#define TYPE_STUB(t)           ((t)->is_stub ())
-
 /* * The target type of this type is a stub type, and this type needs
    to be updated if it gets un-stubbed in check_typedef.  Used for
    arrays and ranges, in which TYPE_LENGTH of the array/range gets set
@@ -1084,6 +1078,10 @@ struct type
     this->main_type->m_flag_nosign = has_no_signedness;
   }
 
+  /* This appears in a type's flags word if it is a stub type (e.g.,
+     if someone referenced a type that wasn't defined in a source file
+     via (struct sir_not_appearing_in_this_film *)).  */
+
   bool is_stub () const
   {
     return this->main_type->m_flag_stub;
@@ -1841,7 +1839,7 @@ extern void set_type_vptr_basetype (struct type *, struct type *);
    && ((thistype)->num_fields () == 0) \
    && (!HAVE_CPLUS_STRUCT (thistype) \
        || TYPE_NFN_FIELDS (thistype) == 0) \
-   && (TYPE_STUB (thistype) || !TYPE_STUB_SUPPORTED (thistype)))
+   && ((thistype)->is_stub () || !TYPE_STUB_SUPPORTED (thistype)))
 
 /* * A helper macro that returns the name of a type or "unnamed type"
    if the type has no name.  */
index b0a3ce3ec3e072af7acf2db2632640c743e365d6..9f5ce7e9a271839e792c04355e8a0df4382339a2 100644 (file)
@@ -383,7 +383,7 @@ m2_value_print_inner (struct value *val, struct ui_file *stream, int recurse,
     case TYPE_CODE_SET:
       elttype = type->index_type ();
       elttype = check_typedef (elttype);
-      if (TYPE_STUB (elttype))
+      if (elttype->is_stub ())
        {
          fprintf_styled (stream, metadata_style.style (),
                          _("<incomplete type>"));
index 7842b63081c73cf5bbc329f2da5adfcf1954c3e5..6a6f3ddacc949f852b4b6bbdf9606f4aee77db2e 100644 (file)
@@ -561,7 +561,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
          fprintf_filtered (stream, "\n");
          if ((type->num_fields () == 0) && (TYPE_NFN_FIELDS (type) == 0))
            {
-             if (TYPE_STUB (type))
+             if (type->is_stub ())
                fprintfi_filtered (level + 4, stream, "<incomplete type>\n");
              else
                fprintfi_filtered (level + 4, stream, "<no data fields>\n");
index c98f3c5bf735bcf2a2567a3f0013bb0902c36368..096a75eaea45de2228577e83c09eab12548066c8 100644 (file)
@@ -330,7 +330,7 @@ pascal_value_print_inner (struct value *val, struct ui_file *stream,
     case TYPE_CODE_SET:
       elttype = type->index_type ();
       elttype = check_typedef (elttype);
-      if (TYPE_STUB (elttype))
+      if (elttype->is_stub ())
        {
          fprintf_styled (stream, metadata_style.style (), "<incomplete type>");
          break;
index d0dfb52811b272d22013dccb6e0bda8844b5f441..2e175b641d85528de6587255753e514cf6f3b811 100644 (file)
@@ -1363,7 +1363,7 @@ type_to_type_object (struct type *type)
   try
     {
       /* Try not to let stub types leak out to Python.  */
-      if (TYPE_STUB (type))
+      if (type->is_stub ())
        type = check_typedef (type);
     }
   catch (...)
index ce4c6f1be3182ef842803250c9fc912abf657801..33a23cb61eec5635efc22183eea1418da2648ecf 100644 (file)
@@ -2336,7 +2336,7 @@ read_member_functions (struct stab_field_info *fip, const char **pp,
                        == TYPE_CODE_METHOD);
 
          /* If this is just a stub, then we don't have the real name here.  */
-         if (TYPE_STUB (new_sublist->fn_field.type))
+         if (new_sublist->fn_field.type->is_stub ())
            {
              if (!TYPE_SELF_TYPE (new_sublist->fn_field.type))
                set_type_self_type (new_sublist->fn_field.type, type);
@@ -3429,7 +3429,7 @@ read_struct_type (const char **pp, struct type *type, enum type_code type_code,
      scribbling on existing structure type objects when new definitions
      appear.  */
   if (! (type->code () == TYPE_CODE_UNDEF
-         || TYPE_STUB (type)))
+         || type->is_stub ()))
     {
       complain_about_struct_wipeout (type);
 
@@ -4453,7 +4453,7 @@ cleanup_undefined_types_1 (void)
               as well as in check_typedef to deal with the (legitimate in
               C though not C++) case of several types with the same name
               in different source files.  */
-           if (TYPE_STUB (*type))
+           if ((*type)->is_stub ())
              {
                struct pending *ppt;
                int i;
index 676bdd6a7f0ba8f5238c8a7f04139a7e92ddb7c1..d16e9b8bd7cad1d8db16914310a9164490c8bbe8 100644 (file)
@@ -947,7 +947,7 @@ do_val_print (struct value *value, struct ui_file *stream, int recurse,
      only a stub and we can't find and substitute its complete type, then
      print appropriate string and return.  */
 
-  if (TYPE_STUB (real_type))
+  if (real_type->is_stub ())
     {
       fprintf_styled (stream, metadata_style.style (), _("<incomplete type>"));
       return;
This page took 0.052553 seconds and 4 git commands to generate.