summaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-10 20:28:00 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>1998-12-10 20:28:00 +0000
commit956512913860ad539c4c2c5382f2418776c27865 (patch)
tree1772e0af80d015dfe5d83b4dfff3f622c83554e9 /gcc/java/decl.c
parent31a162bded92e6dcdeb70b85ee88372a6e14ce98 (diff)
downloadgcc-956512913860ad539c4c2c5382f2418776c27865.tar.gz
Thu Dec 10 20:00:54 1998 Alexandre Petit-Bianco <apbianco@sendai.cygnus.com>
* decl.c (long_zero_node, float_zero_node, double_zero_node): New global variables, initialized. * java-tree.h (long_zero_node, float_zero_node, double_zero_node): Declared new global variables. * lex.c (java_lex): Return long_zero_node, float_zero_node, double_zero_node, integer_zero_node upon direct matching. * parse.y (purify_type_name): Added function prototype. (duplicate_declaration_error_p): Consider new_type as potentially being a incomplete type. Use purify_type_name on type string. (method_header): saved_type: unused variable removed. Don't figure return type if method name is invalid. (java_complete_tree): Set CAN_COMPLETE_NORMALLY after `node' was processed by patch_unaryop. (patch_unaryop): Fixed typo in comment. Re-convert pre/post increment/decrement node into its original type after binary numeric promotion on its operands. Fixes a bug occuring when an error occurs in constructor declaration. Fixes a bug on ++/-- operators on non integer operands. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24255 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r--gcc/java/decl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 1cfaf128827..e0fbcfbcfca 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -316,9 +316,14 @@ tree class_dtable_decl;
tree error_mark_node;
/* Two expressions that are constants with value zero.
- The first is of type `int', the second of type `void *'. */
+ The first is of type `int', the second of type `void *'.
+ Other of type `long', `float' and `double' follow. */
tree integer_zero_node;
tree null_pointer_node;
+tree long_zero_node;
+tree float_zero_node;
+tree double_zero_node;
+
tree empty_stmt_node;
/* Nodes for boolean constants TRUE and FALSE. */
@@ -467,6 +472,9 @@ init_decl_processing ()
integer_four_node = build_int_2 (4, 0);
integer_negative_one_node = build_int_2 (-1, 0);
+ long_zero_node = build_int_2 (0, 0);
+ TREE_TYPE (long_zero_node) = long_type_node;
+
void_type_node = make_node (VOID_TYPE);
pushdecl (build_decl (TYPE_DECL, get_identifier ("void"), void_type_node));
layout_type (void_type_node); /* Uses size_zero_node */
@@ -524,6 +532,9 @@ init_decl_processing ()
double_type_node));
layout_type (double_type_node);
+ float_zero_node = build_real (float_type_node, dconst0);
+ double_zero_node = build_real (double_type_node, dconst0);
+
unqualified_object_id_node = get_identifier ("Object");
object_type_node = lookup_class (get_identifier ("java.lang.Object"));
object_ptr_type_node = promote_type (object_type_node);