+2020-09-14  Simon Marchi  <simon.marchi@efficios.com>
+
+       * gdbtypes.h (struct type) <is_gnu_ifunc, set_is_gnu_ifunc>: New methods.
+       (TYPE_GNU_IFUNC): Use type::is_gnu_ifunc, change all write call sites to
+       use type::set_is_gnu_ifunc.
+
 2020-09-14  Simon Marchi  <simon.marchi@efficios.com>
 
        * gdbtypes.h (TYPE_STUB_SUPPORTED): Remove, replace all
 
   objfile_type->nodebug_text_symbol
     = init_type (objfile, TYPE_CODE_FUNC, TARGET_CHAR_BIT,
                 "<text variable, no debug info>");
+
   objfile_type->nodebug_text_gnu_ifunc_symbol
     = init_type (objfile, TYPE_CODE_FUNC, TARGET_CHAR_BIT,
                 "<text gnu-indirect-function variable, no debug info>");
-  TYPE_GNU_IFUNC (objfile_type->nodebug_text_gnu_ifunc_symbol) = 1;
+  objfile_type->nodebug_text_gnu_ifunc_symbol->set_is_gnu_ifunc (true);
+
   objfile_type->nodebug_got_plt_symbol
     = init_pointer_type (objfile, gdbarch_addr_bit (gdbarch),
                         "<text from jump slot in .got.plt, no debug info>",
 
    determines the final returned function type to be presented to
    user.  */
 
-#define TYPE_GNU_IFUNC(t)      (TYPE_MAIN_TYPE (t)->flag_gnu_ifunc)
+#define TYPE_GNU_IFUNC(t)      ((t)->is_gnu_ifunc ())
 
 /* * Type owner.  If TYPE_OBJFILE_OWNED is true, the type is owned by
    the objfile retrieved as TYPE_OBJFILE.  Otherwise, the type is
   unsigned int m_flag_varargs : 1;
   unsigned int m_flag_vector : 1;
   unsigned int m_flag_stub_supported : 1;
-  unsigned int flag_gnu_ifunc : 1;
+  unsigned int m_flag_gnu_ifunc : 1;
   unsigned int flag_fixed_instance : 1;
   unsigned int flag_objfile_owned : 1;
   unsigned int flag_endianity_not_default : 1;
     this->main_type->m_flag_stub_supported = stub_is_supported;
   }
 
+  bool is_gnu_ifunc () const
+  {
+    return this->main_type->m_flag_gnu_ifunc;
+  }
+
+  void set_is_gnu_ifunc (bool is_gnu_ifunc)
+  {
+    this->main_type->m_flag_gnu_ifunc = is_gnu_ifunc;
+  }
+
   /* * 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;