summaryrefslogtreecommitdiff
path: root/gcc/java/lex.c
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-05 09:03:42 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2004-08-05 09:03:42 +0000
commit4d28c5d1bd79990e131ac7994d9f3e8b4ea03b5d (patch)
tree267e3abff19f5eff30100b2ff7fa407469a91070 /gcc/java/lex.c
parent8bf71901fab1df87a505e7d4540de31ac3f87462 (diff)
downloadgcc-4d28c5d1bd79990e131ac7994d9f3e8b4ea03b5d.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85599 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/lex.c')
-rw-r--r--gcc/java/lex.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index 77e38f89848..95fbd5763c4 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;
}