gdb: add type::is_unsigned / type::set_is_unsigned

Add the `is_unsigned` and `set_is_unsigned` methods on `struct type`, in
order to remove the `TYPE_UNSIGNED` macro.  In this patch, the
`TYPE_UNSIGNED` macro is changed to use `type::is_unsigned`, so all the
call sites that are used to set this property on a type are changed to
use the new method.  The next patch will remove the macro completely.

gdb/ChangeLog:

	* gdbtypes.h (struct type) <is_unsigned, set_is_unsigned>: New
	methods.
	(TYPE_UNSIGNED): Use type::is_unsigned.  Change all write call
	sites to use type::set_is_unsigned.

Change-Id: Ib09ddce84eda160a801a8f288cccf61c8ef136bc
This commit is contained in:
Simon Marchi 2020-09-14 11:07:56 -04:00
parent 55ea94da36
commit 653223d356
10 changed files with 48 additions and 27 deletions

View file

@ -754,7 +754,7 @@ create_enum (struct gdbarch *gdbarch, int bit, const char *name,
type->set_num_fields (count);
type->set_fields
((struct field *) TYPE_ZALLOC (type, sizeof (struct field) * count));
TYPE_UNSIGNED (type) = 1;
type->set_is_unsigned (true);
for (i = 0; i < count; i++)
{