OSDN Git Service

2000-08-15 Alexandre Petit-Bianco <apbianco@cygnus.com>
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Aug 2000 21:50:48 +0000 (21:50 +0000)
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 Aug 2000 21:50:48 +0000 (21:50 +0000)
        * decl.c (finit_leg_identifier_node): New global.
        (init_decl_processing): Use `finit$' to initialize
        finit_identifier_node. Use `$finit$' to initialize
        finit_leg_identifier_node.
        * expr.c (expand_java_field_op): Use ID_FINIT_P.
        * java-tree.h (finit_identifier_node): Changed attached comment.
        (finit_leg_identifier_node): New declaration.
        (ID_FINIT_P): Take finit_identifier_node and
        finit_leg_identifier_node into account. This is a backward
        compatibility hack.

(http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00664.html
 See also the matching Java run-time patch:
 http://sources.redhat.com/ml/java-discuss/2000-08/msg00031.html)

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35768 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/decl.c
gcc/java/expr.c
gcc/java/java-tree.h

index 4c889b0..99578ff 100644 (file)
@@ -1,3 +1,16 @@
+2000-08-15  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * decl.c (finit_leg_identifier_node): New global.
+       (init_decl_processing): Use `finit$' to initialize
+       finit_identifier_node. Use `$finit$' to initialize
+       finit_leg_identifier_node.
+       * expr.c (expand_java_field_op): Use ID_FINIT_P.
+       * java-tree.h (finit_identifier_node): Changed attached comment.
+       (finit_leg_identifier_node): New declaration.
+       (ID_FINIT_P): Take finit_identifier_node and
+       finit_leg_identifier_node into account. This is a backward
+       compatibility hack.
+
 2000-08-14  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * jcf-write.c (generate_bytecode_conditional): Re-installed lost
@@ -40,7 +53,7 @@ Sun Aug 13 09:41:49 2000  Anthony Green  <green@redhat.com>
        `case' statement.
        (patch_assignment): Set DECL_INITIAL on integral final local.
 
-2000-08-07  Alexandre Petit-Bianco  <apbianco@cygnus.com
+2000-08-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
 
        * parse.y (build_dot_class_method_invocation): Changed parameter
        name to `type.' Build signature from `type' and convert it to a
index 0615633..f57ed01 100644 (file)
@@ -360,6 +360,7 @@ tree TYPE_identifier_node;
 tree init_identifier_node;
 tree clinit_identifier_node;
 tree finit_identifier_node;
+tree finit_leg_identifier_node;
 tree void_signature_node;
 tree length_identifier_node;
 tree this_identifier_node;
@@ -646,7 +647,12 @@ init_decl_processing ()
   TYPE_identifier_node = get_identifier ("TYPE");
   init_identifier_node = get_identifier ("<init>");
   clinit_identifier_node = get_identifier ("<clinit>");
-  finit_identifier_node = get_identifier ("$finit$");
+  /* Legacy `$finit$' special method identifier. This needs to be
+     recognized as equivalent to `finit$' but isn't generated anymore.  */
+  finit_leg_identifier_node = get_identifier ("$finit$");
+  /* The new `finit$' special method identifier. This one is now
+     generated in place of `$finit$'.  */
+  finit_identifier_node = get_identifier ("finit$");
   void_signature_node = get_identifier ("()V");
   length_identifier_node = get_identifier ("length");
   this_identifier_node = get_identifier ("this");
index af59e63..e3e5f8e 100644 (file)
@@ -2210,7 +2210,7 @@ expand_java_field_op (is_static, is_putting, field_ref_index)
            {
              tree cfndecl_name = DECL_NAME (current_function_decl);
              if (! DECL_CONSTRUCTOR_P (current_function_decl)
-                 && (cfndecl_name != finit_identifier_node))
+                 && !ID_FINIT_P (cfndecl_name))
                error_with_decl (field_decl, "assignment to final field `%s' not in constructor");
            }
        }
index 7d2d74f..a609820 100644 (file)
@@ -253,7 +253,8 @@ extern tree double_array_vtable;
 extern tree TYPE_identifier_node;      /* "TYPE" */
 extern tree init_identifier_node;      /* "<init>" */
 extern tree clinit_identifier_node;      /* "<clinit>" */
-extern tree finit_identifier_node;      /* "$finit$" */
+extern tree finit_identifier_node;      /* "finit$" */
+extern tree finit_leg_identifier_node;  /* "$finit$" */
 extern tree void_signature_node;       /* "()V" */
 extern tree length_identifier_node;  /* "length" */
 extern tree this_identifier_node;  /* "this" */
@@ -821,7 +822,12 @@ struct rtx_def * java_lang_expand_expr PARAMS ((tree, rtx, enum machine_mode,
 /* Predicates on method identifiers. Kept close to other macros using
    them  */
 #define ID_INIT_P(ID)   ((ID) == init_identifier_node)
-#define ID_FINIT_P(ID)  ((ID) == finit_identifier_node)
+/* Match ID to either `$finit$' or `finit$', so that `$finit$'
+   continues to be recognized as an equivalent to `finit$' which is
+   now the prefered name used for the field initialization special
+   method.  */
+#define ID_FINIT_P(ID)  ((ID) == finit_identifier_node \
+                        || (ID) == finit_leg_identifier_node)
 #define ID_CLINIT_P(ID) ((ID) == clinit_identifier_node)
 
 /* Access flags etc for a variable/field (a FIELD_DECL): */