aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-04-01 08:46:10 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-04-01 08:46:10 +0000
commitceef8ce4b43a36a75e3c7df8a8696866fc398a56 (patch)
treea06146fa6279ee4373ef4b809f8c3aedca99fb3f /gcc/java
parentc7a39ea995852db80b150e9b24c68f56461aff6d (diff)
downloadgcc-ceef8ce4b43a36a75e3c7df8a8696866fc398a56.zip
gcc-ceef8ce4b43a36a75e3c7df8a8696866fc398a56.tar.gz
gcc-ceef8ce4b43a36a75e3c7df8a8696866fc398a56.tar.bz2
c-common.c (unsigned_conversion_warning, [...]): Use new hooks.
* c-common.c (unsigned_conversion_warning, convert_and_check, unsigned_type, signed_type, shorten_compare, c_common_get_alias_set, c_common_nodes_and_builtins): Use new hooks. (unsigned_type, signed_type, signed_or_unsigned_type): Rename. * c-common.h (unsigned_type, signed_type, signed_or_unsigned_type): New. * c-decl.c (grokdeclarator): Update. * c-format.c (check_format_types): Update. * c-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. * c-typeck.c (build_binary_op, convert_for_assignment): Update. * convert.c (convert_to_integer): Use new hooks. * expmed.c (make_tree): Use new hooks. * expr.c (store_expr): Use new hooks. * fold-const.c (operand_equal_for_comparison_p, build_range_check, all_ones_mask_p, unextend, fold): Use new hooks. * langhooks.h (struct lang_hooks_for_types): New hooks. * tree.h (signed_or_unsigned_type, signed_type, unsigned_type): Remove. ada: * gigi.h (unsigned_type, signed_type, signed_or_unsigned_type): Rename. * misc.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. * trans.c (tree_transform, convert_with_check): Update. * utils.c (unsigned_type, signed_type, signed_or_unsigned_type): Rename. cp: * cp-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. * decl.c (grokdeclarator): Update. * mangle.c (write_integer_cst): Update. * typeck.c (build_binary_op): Update. f: * com.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. (unsigned_type, signed_type, signed_or_unsigned_type): Rename. java: * expr.c (build_java_binop): Update. * java-tree.h (java_signed_type, java_unsigned_type, java_signed_or_unsigned_type): Update. * lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. * parse.y (patch_binop): Update. * typeck.c (signed_or_unsigned_type, unsigned_type, signed_type): Update. objc: * objc-lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE, LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New. From-SVN: r51684
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog11
-rw-r--r--gcc/java/expr.c2
-rw-r--r--gcc/java/java-tree.h3
-rw-r--r--gcc/java/lang.c7
-rw-r--r--gcc/java/parse.y2
-rw-r--r--gcc/java/typeck.c11
6 files changed, 28 insertions, 8 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index a7776f1..269bdc2 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,14 @@
+2002-04-01 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * expr.c (build_java_binop): Update.
+ * java-tree.h (java_signed_type, java_unsigned_type,
+ java_signed_or_unsigned_type): Update.
+ * lang.c (LANG_HOOKS_SIGNED_TYPE, LANG_HOOKS_UNSIGNED_TYPE,
+ LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE): New.
+ * parse.y (patch_binop): Update.
+ * typeck.c (signed_or_unsigned_type, unsigned_type,
+ signed_type): Update.
+
2002-03-31 Neil Booth <neil@daikokuya.demon.co.uk>
* lang.c (LANG_HOOKS_PRINT_ERROR_FUNCTION): Redefine.
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index 895c322..a4ecfb0 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -1395,7 +1395,7 @@ build_java_binop (op, type, arg1, arg2)
{
case URSHIFT_EXPR:
{
- tree u_type = unsigned_type (type);
+ tree u_type = java_unsigned_type (type);
arg1 = convert (u_type, arg1);
arg1 = build_java_binop (RSHIFT_EXPR, u_type, arg1, arg2);
return convert (type, arg1);
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 3f47430..4a55281 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -1041,6 +1041,9 @@ extern void java_parse_file PARAMS ((void));
extern void java_mark_tree PARAMS ((tree));
extern tree java_type_for_mode PARAMS ((enum machine_mode, int));
extern tree java_type_for_size PARAMS ((unsigned int, int));
+extern tree java_unsigned_type PARAMS ((tree));
+extern tree java_signed_type PARAMS ((tree));
+extern tree java_signed_or_unsigned_type PARAMS ((int, tree));
extern void add_assume_compiled PARAMS ((const char *, int));
extern tree lookup_class PARAMS ((tree));
extern tree lookup_java_constructor PARAMS ((tree, tree));
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index b56eea4..05b5ced 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -237,10 +237,17 @@ static int dependency_tracking = 0;
#define LANG_HOOKS_DECL_PRINTABLE_NAME lang_printable_name
#undef LANG_HOOKS_PRINT_ERROR_FUNCTION
#define LANG_HOOKS_PRINT_ERROR_FUNCTION java_print_error_function
+
#undef LANG_HOOKS_TYPE_FOR_MODE
#define LANG_HOOKS_TYPE_FOR_MODE java_type_for_mode
#undef LANG_HOOKS_TYPE_FOR_SIZE
#define LANG_HOOKS_TYPE_FOR_SIZE java_type_for_size
+#undef LANG_HOOKS_SIGNED_TYPE
+#define LANG_HOOKS_SIGNED_TYPE java_signed_type
+#undef LANG_HOOKS_UNSIGNED_TYPE
+#define LANG_HOOKS_UNSIGNED_TYPE java_unsigned_type
+#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
+#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE java_signed_or_unsigned_type
/* Each front end provides its own. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index ef18d5f..436cdf0 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -13402,7 +13402,7 @@ patch_binop (node, wfl_op1, wfl_op2)
if (code == URSHIFT_EXPR && ! flag_emit_class_files)
{
tree to_return;
- tree utype = unsigned_type (prom_type);
+ tree utype = java_unsigned_type (prom_type);
op1 = convert (utype, op1);
TREE_SET_CODE (node, RSHIFT_EXPR);
TREE_OPERAND (node, 0) = op1;
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index 88f3fb9..5afa5a4 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -226,7 +226,7 @@ java_type_for_size (bits, unsignedp)
signed according to UNSIGNEDP. */
tree
-signed_or_unsigned_type (unsignedp, type)
+java_signed_or_unsigned_type (unsignedp, type)
int unsignedp;
tree type;
{
@@ -246,20 +246,19 @@ signed_or_unsigned_type (unsignedp, type)
/* Return a signed type the same as TYPE in other respects. */
tree
-signed_type (type)
+java_signed_type (type)
tree type;
{
- return signed_or_unsigned_type (0, type);
+ return java_signed_or_unsigned_type (0, type);
}
/* Return an unsigned type the same as TYPE in other respects. */
tree
-unsigned_type (type)
+java_unsigned_type (type)
tree type;
{
- return signed_or_unsigned_type (1, type);
-
+ return java_signed_or_unsigned_type (1, type);
}
/* Mark EXP saying that we need to be able to take the