+2020-09-14  Simon Marchi  <simon.marchi@efficios.com>
+
+       * gdbtypes.h (struct type) <is_prototyped, set_is_prototyped>:
+       New methods.
+       (TYPE_PROTOTYPED): Use type::is_prototyped, change all write
+       call sites to use type::set_is_prototyped.
+
 2020-09-14  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbtypes.h (TYPE_TARGET_STUB): Remove, replace all
 
   ftype = lookup_function_type (type);
 
   if (prototyped_function_p (die, cu))
-    TYPE_PROTOTYPED (ftype) = 1;
+    ftype->set_is_prototyped (true);
 
   /* Store the calling convention in the type if it's available in
      the subroutine die.  Otherwise set the calling convention to
 
          --num_types;
          /* Caller should have ensured this.  */
          gdb_assert (num_types == 0);
-         TYPE_PROTOTYPED (type) = 1;
+         type->set_is_prototyped (true);
        }
     }
 
 
          --nparams;
          /* Caller should have ensured this.  */
          gdb_assert (nparams == 0);
-         TYPE_PROTOTYPED (fn) = 1;
+         fn->set_is_prototyped (true);
        }
       else
-       TYPE_PROTOTYPED (fn) = 1;
+       fn->set_is_prototyped (true);
     }
 
   fn->set_num_fields (nparams);
 
    to coerce the args, or to just do the standard conversions.  This
    is used with a short field.  */
 
-#define TYPE_PROTOTYPED(t)     (TYPE_MAIN_TYPE (t)->flag_prototyped)
+#define TYPE_PROTOTYPED(t)     ((t)->is_prototyped ())
 
 /* * FIXME drow/2002-06-03:  Only used for methods, but applies as well
    to functions.  */
   unsigned int m_flag_nosign : 1;
   unsigned int m_flag_stub : 1;
   unsigned int m_flag_target_stub : 1;
-  unsigned int flag_prototyped : 1;
+  unsigned int m_flag_prototyped : 1;
   unsigned int flag_varargs : 1;
   unsigned int flag_vector : 1;
   unsigned int flag_stub_supported : 1;
     this->main_type->m_flag_target_stub = target_is_stub;
   }
 
+  bool is_prototyped () const
+  {
+    return this->main_type->m_flag_prototyped;
+  }
+
+  void set_is_prototyped (bool is_prototyped)
+  {
+    this->main_type->m_flag_prototyped = is_prototyped;
+  }
+
   /* * Return the dynamic property of the requested KIND from this type's
      list of dynamic properties.  */
   dynamic_prop *dyn_prop (dynamic_prop_node_kind kind) const;
 
       /* All functions in C++ have prototypes.  For C we don't have enough
          information in the debug info.  */
       if (s->language () == language_cplus)
-       TYPE_PROTOTYPED (SYMBOL_TYPE (s)) = 1;
+       SYMBOL_TYPE (s)->set_is_prototyped (true);
 
       /* Create and enter a new lexical context.  */
       b = new_block (FUNCTION_BLOCK, s->language ());
 
          than the "declared-as" type for unprototyped functions, so
          we treat all functions as if they were prototyped.  This is used
          primarily for promotion when calling the function from GDB.  */
-      TYPE_PROTOTYPED (SYMBOL_TYPE (sym)) = 1;
+      SYMBOL_TYPE (sym)->set_is_prototyped (true);
 
       /* fall into process_prototype_types.  */
 
              TYPE_FIELD_ARTIFICIAL (ftype, nparams++) = 0;
            }
          ftype->set_num_fields (nparams);
-         TYPE_PROTOTYPED (ftype) = 1;
+         ftype->set_is_prototyped (true);
        }
       break;
 
             func_type->field (i).set_type (t->type);
         }
         func_type->set_num_fields (num_args);
-        TYPE_PROTOTYPED (func_type) = 1;
+       func_type->set_is_prototyped (true);
 
         type = func_type;
         break;