gdb: add type::has_no_signedness / type::set_has_no_signedness

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

Change-Id: I80d8e774316d146fbd814b2928ad5392bada39d5
This commit is contained in:
Simon Marchi
2020-09-14 11:07:57 -04:00
parent c6d940a956
commit 15152a54ae
7 changed files with 26 additions and 9 deletions

View File

@ -5725,7 +5725,7 @@ gdbtypes_post_init (struct gdbarch *gdbarch)
builtin_type->builtin_char
= arch_integer_type (gdbarch, TARGET_CHAR_BIT,
!gdbarch_char_signed (gdbarch), "char");
TYPE_NOSIGN (builtin_type->builtin_char) = 1;
builtin_type->builtin_char->set_has_no_signedness (true);
builtin_type->builtin_signed_char
= arch_integer_type (gdbarch, TARGET_CHAR_BIT,
0, "signed char");
@ -5884,7 +5884,7 @@ objfile_type (struct objfile *objfile)
objfile_type->builtin_char
= init_integer_type (objfile, TARGET_CHAR_BIT,
!gdbarch_char_signed (gdbarch), "char");
TYPE_NOSIGN (objfile_type->builtin_char) = 1;
objfile_type->builtin_char->set_has_no_signedness (true);
objfile_type->builtin_signed_char
= init_integer_type (objfile, TARGET_CHAR_BIT,
0, "signed char");