aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2004-04-01 03:50:43 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2004-03-31 22:50:43 -0500
commit8df83eae1ed8f8f7cfb653bdeb14f2b5071d7c4f (patch)
treecdd0771bc6e7a796038424b013a8a89e08667dea /gcc/c-common.c
parentd9175b871cddac9b9d3c7216bf3a8f665539d782 (diff)
downloadgcc-8df83eae1ed8f8f7cfb653bdeb14f2b5071d7c4f.zip
gcc-8df83eae1ed8f8f7cfb653bdeb14f2b5071d7c4f.tar.gz
gcc-8df83eae1ed8f8f7cfb653bdeb14f2b5071d7c4f.tar.bz2
builtins.c, [...]: Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED.
* builtins.c, c-aux-info.c, c-common.c, c-cppbuiltin.c, c-decl.c: Change most occurrences of TREE_UNSIGNED to TYPE_UNSIGNED. * c-format.c, c-opts.c, c-pretty-print.c, c-typeck.c: Likewise. * calls.c, convert.c, dbxout.c, dojump.c, dwarf2out.c: Likewise. * expmed.c, expr.c, fold-const.c, function.c, integrate.c: Likewise. * optabs.c, sdbout.c, stmt.c, stor-layout.c, tree-dump.c: Likewise. * tree.c, config/iq2000/iq2000.c, config/m32r/m32r.c: Likewise. * config/mips/mips.c, config/rs6000/rs6000.c: Likewise. * config/s390/s390.c, config/sparc/sparc.c, objc/objc-act.c: Likewise. * stor-layout.c (layout_type, case COMPLEX_TYPE): Test for REAL_TYPE, not INTEGER_TYPE. (layout_type, case VECTOR_TYPE): Simplify code. * tree.c (build_vector_type_for_mode): Remove dup unsigned setting. * tree.h: Update comments. (STRIP_NOPS): Use TYPE_UNSIGNED. (TYPE_UNSIGNED): New macro. (TYPE_TRAP_SIGNED): Remove now redundant check. (SAVE_EXPR_NOPLACEHOLDER): Don't use TREE_UNSIGNED. * cp/call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED. * cp/class.c (check_bitfield_decl): Likewise. * cp/cvt.c (type_promotes_to): Likewise. * cp/decl.c (finish_enum): Likewise. * cp/mangle.c (write_builtin_type): Likewise. * cp/semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise. * cp/typeck.c (type_after_usual_arithmetic_conversions): Likewise. (build_binary_op): Likewise. * f/com.c (ffecom_arrayref_): Use TYPE_UNSIGNED, not TREE_UNSIGNED. (ffecom_expr_): Likewise. * java/jcf-write.c (generate_bytecode_insns): Use TYPE_UNSIGNED. * treelang/treetree.c (tree_lang_signed_or_unsigned_type): Use TYPE_UNSIGNED, not TREE_UNSIGNED. * ada/decl.c (gnat_to_gnu_entity, make_type_from_size): Use TYPE_UNSIGNED, not TREE_UNSIGNED. * ada/trans.c (tree_transform, convert_with_check): Likewise. * ada/utils.c (gnat_signed_or_unsigned_type): Likewise. (build_vms_descriptor, unchecked_convert): Likewise. * ada/utils2.c (nonbinary_modular_operation): Likewise. From-SVN: r80287
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index c7b73cc..a3904ca 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -1248,7 +1248,7 @@ unsigned_conversion_warning (tree result, tree operand)
if (TREE_CODE (operand) == INTEGER_CST
&& TREE_CODE (type) == INTEGER_TYPE
- && TREE_UNSIGNED (type)
+ && TYPE_UNSIGNED (type)
&& skip_evaluation == 0
&& !int_fits_type_p (operand, type))
{
@@ -1292,13 +1292,13 @@ convert_and_check (tree type, tree expr)
TREE_CONSTANT_OVERFLOW (t) = TREE_CONSTANT_OVERFLOW (expr);
/* No warning for converting 0x80000000 to int. */
- if (!(TREE_UNSIGNED (type) < TREE_UNSIGNED (TREE_TYPE (expr))
+ if (!(TYPE_UNSIGNED (type) < TYPE_UNSIGNED (TREE_TYPE (expr))
&& TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
&& TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (expr))))
/* If EXPR fits in the unsigned version of TYPE,
don't warn unless pedantic. */
if ((pedantic
- || TREE_UNSIGNED (type)
+ || TYPE_UNSIGNED (type)
|| ! constant_fits_type_p (expr,
c_common_unsigned_type (type)))
&& skip_evaluation == 0)
@@ -1963,7 +1963,7 @@ tree
c_common_signed_or_unsigned_type (int unsignedp, tree type)
{
if (! INTEGRAL_TYPE_P (type)
- || TREE_UNSIGNED (type) == unsignedp)
+ || TYPE_UNSIGNED (type) == unsignedp)
return type;
/* Must check the mode of the types, not the precision. Enumeral types
@@ -2148,9 +2148,9 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
but it *requires* conversion to FINAL_TYPE. */
if (op0 == primop0 && TREE_TYPE (op0) != *restype_ptr)
- unsignedp0 = TREE_UNSIGNED (TREE_TYPE (op0));
+ unsignedp0 = TYPE_UNSIGNED (TREE_TYPE (op0));
if (op1 == primop1 && TREE_TYPE (op1) != *restype_ptr)
- unsignedp1 = TREE_UNSIGNED (TREE_TYPE (op1));
+ unsignedp1 = TYPE_UNSIGNED (TREE_TYPE (op1));
/* If one of the operands must be floated, we cannot optimize. */
real1 = TREE_CODE (TREE_TYPE (primop0)) == REAL_TYPE;
@@ -2222,7 +2222,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
int min_gt, max_gt, min_lt, max_lt;
tree maxval, minval;
/* 1 if comparison is nominally unsigned. */
- int unsignedp = TREE_UNSIGNED (*restype_ptr);
+ int unsignedp = TYPE_UNSIGNED (*restype_ptr);
tree val;
type = c_common_signed_or_unsigned_type (unsignedp0,
@@ -2379,7 +2379,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
{
type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1));
type = c_common_signed_or_unsigned_type (unsignedp0
- || TREE_UNSIGNED (*restype_ptr),
+ || TYPE_UNSIGNED (*restype_ptr),
type);
/* Make sure shorter operand is extended the right way
to match the longer operand. */
@@ -2401,7 +2401,7 @@ shorten_compare (tree *op0_ptr, tree *op1_ptr, tree *restype_ptr,
primop1 = op1;
if (!real1 && !real2 && integer_zerop (primop1)
- && TREE_UNSIGNED (*restype_ptr))
+ && TYPE_UNSIGNED (*restype_ptr))
{
tree value = 0;
switch (code)
@@ -2502,7 +2502,7 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
/* If the constant is unsigned, and smaller than the pointer size,
then we must skip this optimization. This is because it could cause
an overflow error if the constant is negative but INTOP is not. */
- && (! TREE_UNSIGNED (TREE_TYPE (intop))
+ && (! TYPE_UNSIGNED (TREE_TYPE (intop))
|| (TYPE_PRECISION (TREE_TYPE (intop))
== TYPE_PRECISION (TREE_TYPE (ptrop)))))
{
@@ -2522,9 +2522,9 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
so the multiply won't overflow spuriously. */
if (TYPE_PRECISION (TREE_TYPE (intop)) != TYPE_PRECISION (sizetype)
- || TREE_UNSIGNED (TREE_TYPE (intop)) != TREE_UNSIGNED (sizetype))
+ || TYPE_UNSIGNED (TREE_TYPE (intop)) != TYPE_UNSIGNED (sizetype))
intop = convert (c_common_type_for_size (TYPE_PRECISION (sizetype),
- TREE_UNSIGNED (sizetype)), intop);
+ TYPE_UNSIGNED (sizetype)), intop);
/* Replace the integer argument with a suitable product by the object size.
Do this multiplication as signed, then convert to the appropriate
@@ -2821,7 +2821,7 @@ c_common_get_alias_set (tree t)
/* The C standard specifically allows aliasing between signed and
unsigned variants of the same type. We treat the signed
variant as canonical. */
- if (TREE_CODE (t) == INTEGER_TYPE && TREE_UNSIGNED (t))
+ if (TREE_CODE (t) == INTEGER_TYPE && TYPE_UNSIGNED (t))
{
tree t1 = c_common_signed_type (t);
@@ -3220,7 +3220,7 @@ c_common_nodes_and_builtins (void)
wchar_type_size = TYPE_PRECISION (wchar_type_node);
if (c_dialect_cxx ())
{
- if (TREE_UNSIGNED (wchar_type_node))
+ if (TYPE_UNSIGNED (wchar_type_node))
wchar_type_node = make_unsigned_type (wchar_type_size);
else
wchar_type_node = make_signed_type (wchar_type_size);
@@ -4608,7 +4608,7 @@ handle_mode_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
warning ("use __attribute__ ((vector_size)) instead");
}
- typefm = lang_hooks.types.type_for_mode (mode, TREE_UNSIGNED (type));
+ typefm = lang_hooks.types.type_for_mode (mode, TYPE_UNSIGNED (type));
if (typefm == NULL_TREE)
error ("no data type for mode `%s'", p);