diff options
author | Richard Kenner <kenner@vlsi1.ultra.nyu.edu> | 2004-04-01 03:50:43 +0000 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2004-03-31 22:50:43 -0500 |
commit | 8df83eae1ed8f8f7cfb653bdeb14f2b5071d7c4f (patch) | |
tree | cdd0771bc6e7a796038424b013a8a89e08667dea /gcc/cp | |
parent | d9175b871cddac9b9d3c7216bf3a8f665539d782 (diff) | |
download | gcc-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/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/cp/call.c | 2 | ||||
-rw-r--r-- | gcc/cp/class.c | 14 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 4 | ||||
-rw-r--r-- | gcc/cp/decl.c | 6 | ||||
-rw-r--r-- | gcc/cp/mangle.c | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 31 |
8 files changed, 43 insertions, 35 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dc05a91..077fcef 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,14 @@ +2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> + + * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED. + * class.c (check_bitfield_decl): Likewise. + * cvt.c (type_promotes_to): Likewise. + * decl.c (finish_enum): Likewise. + * mangle.c (write_builtin_type): Likewise. + * semantics.c (finish_switch_cond, finish_unary_op_expr): Likewise. + * typeck.c (type_after_usual_arithmetic_conversions): Likewise. + (build_binary_op): Likewise. + 2004-03-31 Jan Hubicka <jh@suse.cz> * tree.h (optimize_function): Kill prototype. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 06070fe..56e089d 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5922,7 +5922,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) && TREE_CODE (t2->type) == INTEGER_TYPE && (TYPE_PRECISION (t1->type) == TYPE_PRECISION (t2->type)) - && (TREE_UNSIGNED (t1->u.next->type) + && (TYPE_UNSIGNED (t1->u.next->type) || (TREE_CODE (t1->u.next->type) == ENUMERAL_TYPE))) { diff --git a/gcc/cp/class.c b/gcc/cp/class.c index de0517f..fe49e26 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -2710,11 +2710,11 @@ check_bitfield_decl (tree field) else if (TREE_CODE (type) == ENUMERAL_TYPE && (0 > compare_tree_int (w, min_precision (TYPE_MIN_VALUE (type), - TREE_UNSIGNED (type))) + TYPE_UNSIGNED (type))) || 0 > compare_tree_int (w, min_precision (TYPE_MAX_VALUE (type), - TREE_UNSIGNED (type))))) + TYPE_UNSIGNED (type))))) cp_warning_at ("`%D' is too small to hold all values of `%#T'", field, type); } @@ -6906,15 +6906,13 @@ build_vtt_inits (tree binfo, tree t, tree* inits, tree* index) return inits; } -/* Called from build_vtt_inits via dfs_walk. BINFO is the binfo - for the base in most derived. DATA is a TREE_LIST who's - TREE_CHAIN is the type of the base being - constructed whilst this secondary vptr is live. The TREE_UNSIGNED - flag of DATA indicates that this is a constructor vtable. The +/* Called from build_vtt_inits via dfs_walk. BINFO is the binfo for the base + in most derived. DATA is a TREE_LIST who's TREE_CHAIN is the type of the + base being constructed whilst this secondary vptr is live. The TREE_TOP_LEVEL flag indicates that this is the primary VTT. */ static tree -dfs_build_secondary_vptr_vtt_inits (tree binfo, void* data) +dfs_build_secondary_vptr_vtt_inits (tree binfo, void *data) { tree l; tree t; diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index ada5888..bf906fd 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -1116,7 +1116,7 @@ type_promotes_to (tree type) int precision = MAX (TYPE_PRECISION (type), TYPE_PRECISION (integer_type_node)); tree totype = c_common_type_for_size (precision, 0); - if (TREE_UNSIGNED (type) + if (TYPE_UNSIGNED (type) && ! int_fits_type_p (TYPE_MAX_VALUE (type), totype)) type = c_common_type_for_size (precision, 1); else @@ -1125,7 +1125,7 @@ type_promotes_to (tree type) else if (c_promoting_integer_type_p (type)) { /* Retain unsignedness if really not getting bigger. */ - if (TREE_UNSIGNED (type) + if (TYPE_UNSIGNED (type) && TYPE_PRECISION (type) == TYPE_PRECISION (integer_type_node)) type = unsigned_type_node; else diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index ce530fa..4570d8b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9759,7 +9759,7 @@ finish_enum (tree enumtype) { underlying_type = integer_types[itk]; if (TYPE_PRECISION (underlying_type) >= precision - && TREE_UNSIGNED (underlying_type) == unsignedp) + && TYPE_UNSIGNED (underlying_type) == unsignedp) break; } if (itk == itk_none) @@ -9796,7 +9796,7 @@ finish_enum (tree enumtype) TYPE_MODE (enumtype) = TYPE_MODE (underlying_type); TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type); TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type); - TREE_UNSIGNED (enumtype) = TREE_UNSIGNED (underlying_type); + TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type); /* Convert each of the enumerators to the type of the underlying type of the enumeration. */ @@ -9822,7 +9822,7 @@ finish_enum (tree enumtype) TYPE_PRECISION (t) = TYPE_PRECISION (enumtype); TYPE_ALIGN (t) = TYPE_ALIGN (enumtype); TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype); - TREE_UNSIGNED (t) = TREE_UNSIGNED (enumtype); + TYPE_UNSIGNED (t) = TYPE_UNSIGNED (enumtype); } /* Finish debugging output for this type. */ diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index d8c615b..81ac4ad 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1693,11 +1693,11 @@ write_builtin_type (tree type) if (itk == itk_none) { tree t = c_common_type_for_mode (TYPE_MODE (type), - TREE_UNSIGNED (type)); + TYPE_UNSIGNED (type)); if (type == t) { if (TYPE_PRECISION (type) == 128) - write_char (TREE_UNSIGNED (type) ? 'o' : 'n'); + write_char (TYPE_UNSIGNED (type) ? 'o' : 'n'); else /* Couldn't find this type. */ abort (); diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 3a1fcb4..6e15e61 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -766,8 +766,8 @@ finish_switch_cond (tree cond, tree switch_stmt) because if we did, int_fits_type_p would do the wrong thing when checking case values for being in range, and it's too hard to do the right thing. */ - if (TREE_UNSIGNED (TREE_TYPE (cond)) - == TREE_UNSIGNED (TREE_TYPE (index))) + if (TYPE_UNSIGNED (TREE_TYPE (cond)) + == TYPE_UNSIGNED (TREE_TYPE (index))) cond = index; } } @@ -1838,7 +1838,7 @@ finish_unary_op_expr (enum tree_code code, tree expr) setting TREE_NEGATED_INT. */ if (code == NEGATE_EXPR && TREE_CODE (expr) == INTEGER_CST && TREE_CODE (result) == INTEGER_CST - && !TREE_UNSIGNED (TREE_TYPE (result)) + && !TYPE_UNSIGNED (TREE_TYPE (result)) && INT_CST_LT (result, integer_zero_node)) TREE_NEGATED_INT (result) = 1; overflow_warning (result); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index edd86ea..a0145a0 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -347,7 +347,7 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2) if (same_type_p (TYPE_MAIN_VARIANT (t1), long_long_integer_type_node) || same_type_p (TYPE_MAIN_VARIANT (t2), long_long_integer_type_node)) { - tree t = ((TREE_UNSIGNED (t1) || TREE_UNSIGNED (t2)) + tree t = ((TYPE_UNSIGNED (t1) || TYPE_UNSIGNED (t2)) ? long_long_unsigned_type_node : long_long_integer_type_node); return build_type_attribute_variant (t, attributes); @@ -361,12 +361,12 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2) if (same_type_p (TYPE_MAIN_VARIANT (t1), long_integer_type_node) || same_type_p (TYPE_MAIN_VARIANT (t2), long_integer_type_node)) { - tree t = ((TREE_UNSIGNED (t1) || TREE_UNSIGNED (t2)) + tree t = ((TYPE_UNSIGNED (t1) || TYPE_UNSIGNED (t2)) ? long_unsigned_type_node : long_integer_type_node); return build_type_attribute_variant (t, attributes); } /* Otherwise prefer the unsigned one. */ - if (TREE_UNSIGNED (t1)) + if (TYPE_UNSIGNED (t1)) return build_type_attribute_variant (t1, attributes); else return build_type_attribute_variant (t2, attributes); @@ -2872,7 +2872,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, point, so we have to dig out the original type to find out if it was unsigned. */ shorten = ((TREE_CODE (op0) == NOP_EXPR - && TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0)))) + && TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0)))) || (TREE_CODE (op1) == INTEGER_CST && ! integer_all_onesp (op1))); @@ -2901,7 +2901,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, quotient can't be represented in the computation mode. We shorten only if unsigned or if dividing by something we know != -1. */ shorten = ((TREE_CODE (op0) == NOP_EXPR - && TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0)))) + && TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op0, 0)))) || (TREE_CODE (op1) == INTEGER_CST && ! integer_all_onesp (op1))); common = 1; @@ -3160,7 +3160,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, tree arg0 = get_narrower (op0, &unsigned0); tree arg1 = get_narrower (op1, &unsigned1); /* UNS is 1 if the operation to be done is an unsigned one. */ - int uns = TREE_UNSIGNED (result_type); + int uns = TYPE_UNSIGNED (result_type); tree type; final_type = result_type; @@ -3169,9 +3169,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, but it *requires* conversion to FINAL_TYPE. */ if (op0 == arg0 && TREE_TYPE (op0) != final_type) - unsigned0 = TREE_UNSIGNED (TREE_TYPE (op0)); + unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0)); if (op1 == arg1 && TREE_TYPE (op1) != final_type) - unsigned1 = TREE_UNSIGNED (TREE_TYPE (op1)); + unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1)); /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */ @@ -3223,7 +3223,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, final_type = result_type; if (arg0 == op0 && final_type == TREE_TYPE (op0)) - unsigned_arg = TREE_UNSIGNED (TREE_TYPE (op0)); + unsigned_arg = TYPE_UNSIGNED (TREE_TYPE (op0)); if (TYPE_PRECISION (TREE_TYPE (arg0)) < TYPE_PRECISION (result_type) /* We can shorten only if the shift count is less than the @@ -3236,7 +3236,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, ones made by sign-extension and bring in zeros. We can't optimize that case at all, but in most machines it never happens because available widths are 2**N. */ - && (!TREE_UNSIGNED (final_type) + && (!TYPE_UNSIGNED (final_type) || unsigned_arg || (((unsigned) 2 * TYPE_PRECISION (TREE_TYPE (arg0))) <= TYPE_PRECISION (result_type)))) @@ -3278,8 +3278,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, bound the ranges of the arguments until that point. */ && !processing_template_decl) { - int op0_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op0)); - int op1_signed = ! TREE_UNSIGNED (TREE_TYPE (orig_op1)); + int op0_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op0)); + int op1_signed = !TYPE_UNSIGNED (TREE_TYPE (orig_op1)); int unsignedp0, unsignedp1; tree primop0 = get_narrower (op0, &unsignedp0); @@ -3303,7 +3303,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1, /* Do not warn if the comparison is being done in a signed type, since the signed type will only be chosen if it can represent all the values of the unsigned type. */ - if (! TREE_UNSIGNED (result_type)) + if (!TYPE_UNSIGNED (result_type)) /* OK */; /* Do not warn if both operands are unsigned. */ else if (op0_signed == op1_signed) @@ -5557,10 +5557,9 @@ dubious_conversion_warnings (tree type, tree expr, } /* And warn about assigning a negative value to an unsigned variable. */ - else if (TREE_UNSIGNED (type) && TREE_CODE (type) != BOOLEAN_TYPE) + else if (TYPE_UNSIGNED (type) && TREE_CODE (type) != BOOLEAN_TYPE) { - if (TREE_CODE (expr) == INTEGER_CST - && TREE_NEGATED_INT (expr)) + if (TREE_CODE (expr) == INTEGER_CST && TREE_NEGATED_INT (expr)) { if (fndecl) warning ("passing negative value `%E' for %s %P of `%D'", |