gdb: remove TYPE_UNSIGNED

gdb/ChangeLog:

	* gdbtypes.h (TYPE_UNSIGNED): Remove, replace all uses with
	type::is_unsigned.

Change-Id: I84f76f5cd44ff7294e421d317376a9e476bc8666
This commit is contained in:
Simon Marchi 2020-09-14 11:07:57 -04:00
parent 653223d356
commit c6d940a956
30 changed files with 88 additions and 86 deletions

View file

@ -1088,7 +1088,7 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
case TYPE_CODE_INT:
if (TYPE_LENGTH (type) > sizeof (LONGEST)) /* Too big */
return -1;
if (!TYPE_UNSIGNED (type))
if (!type->is_unsigned ())
{
*lowp = -(1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1));
*highp = -*lowp - 1;
@ -1811,7 +1811,7 @@ get_unsigned_type_max (struct type *type, ULONGEST *max)
unsigned int n;
type = check_typedef (type);
gdb_assert (type->code () == TYPE_CODE_INT && TYPE_UNSIGNED (type));
gdb_assert (type->code () == TYPE_CODE_INT && type->is_unsigned ());
gdb_assert (TYPE_LENGTH (type) <= sizeof (ULONGEST));
/* Written this way to avoid overflow. */
@ -1828,7 +1828,7 @@ get_signed_type_minmax (struct type *type, LONGEST *min, LONGEST *max)
unsigned int n;
type = check_typedef (type);
gdb_assert (type->code () == TYPE_CODE_INT && !TYPE_UNSIGNED (type));
gdb_assert (type->code () == TYPE_CODE_INT && !type->is_unsigned ());
gdb_assert (TYPE_LENGTH (type) <= sizeof (LONGEST));
n = TYPE_LENGTH (type) * TARGET_CHAR_BIT;
@ -3989,7 +3989,7 @@ check_types_equal (struct type *type1, struct type *type2,
if (type1->code () != type2->code ()
|| TYPE_LENGTH (type1) != TYPE_LENGTH (type2)
|| TYPE_UNSIGNED (type1) != TYPE_UNSIGNED (type2)
|| type1->is_unsigned () != type2->is_unsigned ()
|| TYPE_NOSIGN (type1) != TYPE_NOSIGN (type2)
|| TYPE_ENDIANITY_NOT_DEFAULT (type1) != TYPE_ENDIANITY_NOT_DEFAULT (type2)
|| TYPE_VARARGS (type1) != TYPE_VARARGS (type2)
@ -4272,9 +4272,9 @@ rank_one_type_parm_int (struct type *parm, struct type *arg, struct value *value
else /* signed/unsigned char -> plain char */
return INTEGER_CONVERSION_BADNESS;
}
else if (TYPE_UNSIGNED (parm))
else if (parm->is_unsigned ())
{
if (TYPE_UNSIGNED (arg))
if (arg->is_unsigned ())
{
/* unsigned int -> unsigned int, or
unsigned long -> unsigned long */
@ -4304,7 +4304,7 @@ rank_one_type_parm_int (struct type *parm, struct type *arg, struct value *value
return INTEGER_CONVERSION_BADNESS;
}
}
else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
else if (!TYPE_NOSIGN (arg) && !arg->is_unsigned ())
{
if (integer_types_same_name_p (parm->name (),
arg->name ()))
@ -4394,14 +4394,14 @@ rank_one_type_parm_char (struct type *parm, struct type *arg, struct value *valu
else
return INTEGER_CONVERSION_BADNESS;
}
else if (TYPE_UNSIGNED (parm))
else if (parm->is_unsigned ())
{
if (TYPE_UNSIGNED (arg))
if (arg->is_unsigned ())
return EXACT_MATCH_BADNESS;
else
return INTEGER_PROMOTION_BADNESS;
}
else if (!TYPE_NOSIGN (arg) && !TYPE_UNSIGNED (arg))
else if (!TYPE_NOSIGN (arg) && !arg->is_unsigned ())
return EXACT_MATCH_BADNESS;
else
return INTEGER_CONVERSION_BADNESS;
@ -5064,7 +5064,7 @@ recursive_dump_type (struct type *type, int spaces)
puts_filtered ("\n");
printfi_filtered (spaces, "flags");
if (TYPE_UNSIGNED (type))
if (type->is_unsigned ())
{
puts_filtered (" TYPE_UNSIGNED");
}