diff options
author | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-08-05 09:03:42 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2004-08-05 09:03:42 +0000 |
commit | ca7a3bd7d5c371af20775d28ec20bf57115b20e5 (patch) | |
tree | 267e3abff19f5eff30100b2ff7fa407469a91070 /gcc/java | |
parent | d36837f4cac8268ddb67fcf4f8ecfe323d79d92b (diff) | |
download | gcc-ca7a3bd7d5c371af20775d28ec20bf57115b20e5.zip gcc-ca7a3bd7d5c371af20775d28ec20bf57115b20e5.tar.gz gcc-ca7a3bd7d5c371af20775d28ec20bf57115b20e5.tar.bz2 |
tree.h (force_fit_type): Return a tree, take three flags.
* tree.h (force_fit_type): Return a tree, take three flags.
* fold-const.c (force_fit_type): Set TREE_OVERFLOW and
TREE_CONSTANT_OVERFLOW here.
(int_const_binop, const_binop): Adjust.
(size_int_type): Do sign extension here.
(fold_convert_const, optimize_bit_field_compare,
decode_field_reference, all_ones_mask_p, fold_div_compare, fold,
fold_negate_const, fold_abs_const, fold_not_const): Adjust.
* tree.c (size_in_bytes, int_fits_type_p): Adjust.
* cp/cvt.c (cp_convert_to_pointer): Adjust force_fit_type call.
* java/jcf-parse.c (get_constant): Adjust force_fit_type call.
* java/lex.h (SET_LVAL_NODE_TYPE): Remove.
* java/lex.c (java_perform_atof): Use SET_LVAL_NODE directly.
(do_java_lex): Likewise. Adjust force_fit_type call.
From-SVN: r85599
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/java/jcf-parse.c | 3 | ||||
-rw-r--r-- | gcc/java/lex.c | 27 | ||||
-rw-r--r-- | gcc/java/lex.h | 6 |
4 files changed, 26 insertions, 17 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 015d89a..e2a7684 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2004-08-05 Nathan Sidwell <nathan@codesourcery.com> + + * jcf-parse.c (get_constant): Adjust force_fit_type call. + * lex.h (SET_LVAL_NODE_TYPE): Remove. + * lex.c (java_perform_atof): Use SET_LVAL_NODE directly. + (do_java_lex): Likewise. Adjust force_fit_type call. + 2004-08-04 Roger Sayle <roger@eyesopen.com> Andrew Haley <aph@redhat.com> diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 4e49b1f..272ce96 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -275,12 +275,13 @@ get_constant (JCF *jcf, int index) unsigned HOST_WIDE_INT num = JPOOL_UINT (jcf, index); unsigned HOST_WIDE_INT lo; HOST_WIDE_INT hi; + lshift_double (num, 0, 32, 64, &lo, &hi, 0); num = JPOOL_UINT (jcf, index+1); add_double (lo, hi, num, 0, &lo, &hi); value = build_int_2 (lo, hi); TREE_TYPE (value) = long_type_node; - force_fit_type (value, 0); + value = force_fit_type (value, 0, false, false); break; } diff --git a/gcc/java/lex.c b/gcc/java/lex.c index 77e38f8..95fbd57 100644 --- a/gcc/java/lex.c +++ b/gcc/java/lex.c @@ -939,7 +939,7 @@ java_perform_atof (YYSTYPE *java_lval, char *literal_token, int fflag, } } - SET_LVAL_NODE_TYPE (build_real (type, value), type); + SET_LVAL_NODE (build_real (type, value)); } #endif @@ -1278,9 +1278,10 @@ do_java_lex (YYSTYPE *java_lval) /* Range checking. */ value = build_int_2 (low, high); /* Temporarily set type to unsigned. */ - SET_LVAL_NODE_TYPE (value, (long_suffix - ? unsigned_long_type_node - : unsigned_int_type_node)); + TREE_TYPE (value) = (long_suffix + ? unsigned_long_type_node + : unsigned_int_type_node); + SET_LVAL_NODE (value); /* For base 10 numbers, only values up to the highest value (plus one) can be written. For instance, only ints up to @@ -1300,12 +1301,11 @@ do_java_lex (YYSTYPE *java_lval) } /* Sign extend the value. */ - SET_LVAL_NODE_TYPE (value, (long_suffix ? long_type_node : int_type_node)); - force_fit_type (value, 0); + TREE_TYPE (value) = long_suffix ? long_type_node : int_type_node; + value = force_fit_type (value, 0, false, false); + SET_LVAL_NODE (value); + JAVA_RADIX10_FLAG (value) = radix == 10; -#else - SET_LVAL_NODE_TYPE (build_int_2 (low, high), - long_suffix ? long_type_node : int_type_node); #endif return INT_LIT_TK; } @@ -1314,6 +1314,7 @@ do_java_lex (YYSTYPE *java_lval) if (c == '\'') { int char_lit; + if ((c = java_get_unicode ()) == '\\') char_lit = java_parse_escape_sequence (); else @@ -1334,7 +1335,13 @@ do_java_lex (YYSTYPE *java_lval) char_lit = 0; /* We silently convert it to zero. */ JAVA_LEX_CHAR_LIT (char_lit); - SET_LVAL_NODE_TYPE (build_int_2 (char_lit, 0), char_type_node); +#ifndef JC1_LITE + { + tree value = build_int_2 (char_lit, 0); + TREE_TYPE (value) = char_type_node; + SET_LVAL_NODE (value); + } +#endif return CHAR_LIT_TK; } diff --git a/gcc/java/lex.h b/gcc/java/lex.h index 9a7cad1..bae5047 100644 --- a/gcc/java/lex.h +++ b/gcc/java/lex.h @@ -188,7 +188,6 @@ extern void java_destroy_lexer (java_lexer *); #define BUILD_OPERATOR(TOKEN) return TOKEN #define BUILD_OPERATOR2(TOKEN) return ASSIGN_ANY_TK #define SET_LVAL_NODE(NODE) -#define SET_LVAL_NODE_TYPE(NODE, TYPE) #define BUILD_ID_WFL(EXP) (EXP) #define JAVA_FLOAT_RANGE_ERROR(S) {} #define JAVA_INTEGRAL_RANGE_ERROR(S) do { } while (0) @@ -225,11 +224,6 @@ extern void java_destroy_lexer (java_lexer *); } /* Set java_lval->node and TREE_TYPE(java_lval->node) in macros */ #define SET_LVAL_NODE(NODE) java_lval->node = (NODE) -#define SET_LVAL_NODE_TYPE(NODE,TYPE) \ - { \ - java_lval->node = (NODE); \ - TREE_TYPE (java_lval->node) = (TYPE); \ - } /* Wrap identifier around a wfl */ #define BUILD_ID_WFL(EXP) build_wfl_node ((EXP)) /* Special ways to report error on numeric literals */ |