+2020-09-14 Simon Marchi <simon.marchi@efficios.com>
+
+ * gdbtypes.h (struct type) <has_varargs, set_has_varargs>: New methods.
+ (TYPE_VARARGS): Use type::has_varargs, change all write call sites to
+ use type::set_has_varargs.
+
2020-09-14 Simon Marchi <simon.marchi@efficios.com>
* gdbtypes.h (TYPE_PROTOTYPED): Remove, replace all
tid = ctf_lookup_by_symbol (ccp->fp, idx);
ftype = get_tid_type (ccp->of, tid);
if (finfo.ctc_flags & CTF_FUNC_VARARG)
- TYPE_VARARGS (ftype) = 1;
+ ftype->set_has_varargs (true);
ftype->set_num_fields (argc);
/* If argc is 0, it has a "void" type. */
if (child_die->tag == DW_TAG_formal_parameter)
nparams++;
else if (child_die->tag == DW_TAG_unspecified_parameters)
- TYPE_VARARGS (ftype) = 1;
+ ftype->set_has_varargs (true);
+
child_die = child_die->sibling;
}
if (param_types[num_types - 1] == NULL)
{
--num_types;
- TYPE_VARARGS (type) = 1;
+ type->set_has_varargs (true);
}
else if (check_typedef (param_types[num_types - 1])->code ()
== TYPE_CODE_VOID)
if (param_types[nparams - 1] == NULL)
{
--nparams;
- TYPE_VARARGS (fn) = 1;
+ fn->set_has_varargs (true);
}
else if (check_typedef (param_types[nparams - 1])->code ()
== TYPE_CODE_VOID)
type->set_fields (args);
type->set_num_fields (nargs);
if (varargs)
- TYPE_VARARGS (type) = 1;
+ type->set_has_varargs (true);
TYPE_LENGTH (type) = 1; /* In practice, this is never needed. */
}
/* * FIXME drow/2002-06-03: Only used for methods, but applies as well
to functions. */
-#define TYPE_VARARGS(t) (TYPE_MAIN_TYPE (t)->flag_varargs)
+#define TYPE_VARARGS(t) ((t)->has_varargs ())
/* * Identify a vector type. Gcc is handling this by adding an extra
attribute to the array type. We slurp that in as a new flag of a
unsigned int m_flag_stub : 1;
unsigned int m_flag_target_stub : 1;
unsigned int m_flag_prototyped : 1;
- unsigned int flag_varargs : 1;
+ unsigned int m_flag_varargs : 1;
unsigned int flag_vector : 1;
unsigned int flag_stub_supported : 1;
unsigned int flag_gnu_ifunc : 1;
this->main_type->m_flag_prototyped = is_prototyped;
}
+ bool has_varargs () const
+ {
+ return this->main_type->m_flag_varargs;
+ }
+
+ void set_has_varargs (bool has_varargs)
+ {
+ this->main_type->m_flag_varargs = has_varargs;
+ }
+
/* * 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;