* 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
+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
`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
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;
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");
{
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");
}
}
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" */
/* 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): */