gdb: add type::is_prototyped / type::set_is_prototyped

Add the `is_prototyped` and `set_is_prototyped` methods on `struct
type`, in order to remove the `TYPE_PROTOTYPED` 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) <is_prototyped, set_is_prototyped>:
	New methods.
	(TYPE_PROTOTYPED): Use type::is_prototyped, change all write
	call sites to use type::set_is_prototyped.

Change-Id: I6ba285250fae413f7c1bf2ffcb5a2cedc8e743da
This commit is contained in:
Simon Marchi
2020-09-14 11:08:00 -04:00
parent d218396806
commit 27e69b7aed
7 changed files with 27 additions and 10 deletions

View File

@ -560,10 +560,10 @@ lookup_function_type_with_arguments (struct type *type,
--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);