diff options
author | apbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-17 21:50:48 +0000 |
---|---|---|
committer | apbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-08-17 21:50:48 +0000 |
commit | f01bd317b59c3707306f3b59600baba7c5a05561 (patch) | |
tree | d6762210ff12f7bb57f95f7b1fd99819031fa631 /gcc | |
parent | b729fb0bd4a5d7eb8a896d73eb510edd3fc7bbe5 (diff) | |
download | ppe42-gcc-f01bd317b59c3707306f3b59600baba7c5a05561.tar.gz ppe42-gcc-f01bd317b59c3707306f3b59600baba7c5a05561.zip |
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.
(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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/java/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/java/decl.c | 8 | ||||
-rw-r--r-- | gcc/java/expr.c | 2 | ||||
-rw-r--r-- | gcc/java/java-tree.h | 10 |
4 files changed, 30 insertions, 5 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4c889b0aba0..99578ff0e05 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -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 diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 06156330b59..f57ed0157db 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -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"); diff --git a/gcc/java/expr.c b/gcc/java/expr.c index af59e63ba98..e3e5f8e935f 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -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"); } } diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h index 7d2d74fa0bc..a6098200dd1 100644 --- a/gcc/java/java-tree.h +++ b/gcc/java/java-tree.h @@ -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): */ |