gdb: add type::has_varargs / type::set_has_varargs

Add the `has_varargs` and `set_has_varargs` methods on `struct type`, in
order to remove the `TYPE_VARARGS` macro.  In this patch, the macro is
changed to use the getter, so all the call sites of the macro that are
used as a setter are changed to use the setter method directly.  The
next patch will remove the macro completely.

gdb/ChangeLog:

	* 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.

Change-Id: I898a1093ae40808b37a7c6fced7f6fa2aae604de
This commit is contained in:
Simon Marchi
2020-09-14 11:08:01 -04:00
parent 7f9f399b34
commit 1d6286ed04
6 changed files with 24 additions and 7 deletions

View File

@@ -1142,7 +1142,7 @@ add_stt_func (struct ctf_context *ccp, unsigned long idx)
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. */