gdb: add type::endianity_is_not_default / type::set_endianity_is_not_default

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

Change-Id: I67acd68fcdae424d7e4a601afda78612ad5d92db
This commit is contained in:
Simon Marchi
2020-09-14 11:08:07 -04:00
parent 22c4c60c86
commit db558e34b0
4 changed files with 23 additions and 5 deletions

View File

@ -958,8 +958,8 @@ create_range_type (struct type *result_type, struct type *index_type,
if (high_bound->kind () == PROP_CONST && high_bound->const_val () < 0)
result_type->set_is_unsigned (false);
TYPE_ENDIANITY_NOT_DEFAULT (result_type)
= TYPE_ENDIANITY_NOT_DEFAULT (index_type);
result_type->set_endianity_is_not_default
(index_type->endianity_is_not_default ());
return result_type;
}