+2007-05-16 Rafael Avila de Espindola <espindola@google.com>
+
+ * c-common.c (c_common_signed_or_unsigned_type): Delay the check for
+ INTEGRAL_TYPE_P and TYPE_UNSIGNED.
+ * langhooks.c (get_signed_or_unsigned_type): Don't check for
+ INTEGRAL_TYPE_P or TYPE_UNSIGNED.
+ (lhd_signed_or_unsigned_type): Check for INTEGRAL_TYPE_P and
+ TYPE_UNSIGNED.
+
2007-05-23 Sandra Loosemore <sandra@codesourcery.com>
Nigel Stephens <nigel@mips.com>
Richard Sandiford <richard@codesourcery.com>
c_common_signed_or_unsigned_type (int unsignedp, tree type)
{
tree type1;
- if (!INTEGRAL_TYPE_P (type)
- || TYPE_UNSIGNED (type) == unsignedp)
- return type;
/* This block of code emulates the behavior of the old
c_common_unsigned_type. In particular, it returns
types, and producing a signed or unsigned variant of an
ENUMERAL_TYPE may cause other problems as well. */
+ if (!INTEGRAL_TYPE_P (type)
+ || TYPE_UNSIGNED (type) == unsignedp)
+ return type;
+
#define TYPE_OK(node) \
(TYPE_MODE (type) == TYPE_MODE (node) \
&& (c_dialect_cxx () || TYPE_PRECISION (type) == TYPE_PRECISION (node)))
tree
get_signed_or_unsigned_type (int unsignedp, tree type)
{
- if (!INTEGRAL_TYPE_P (type) || TYPE_UNSIGNED (type) == unsignedp)
- return type;
-
return lang_hooks.types.signed_or_unsigned_type(unsignedp, type);
}
tree
lhd_signed_or_unsigned_type (int unsignedp, tree type)
{
+ if (!INTEGRAL_TYPE_P (type) || TYPE_UNSIGNED (type) == unsignedp)
+ return type;
+
return lang_hooks.types.type_for_size (TYPE_PRECISION (type), unsignedp);
}