Commit 38c9d142 by Ranjit Mathew

re PR java/19870 (gcj -C doesn't generate accessors for private members across…

re PR java/19870 (gcj -C doesn't generate accessors for private members across nested class boundaries)

	PR java/19870.
	* java-tree.h (OUTER_FIELD_ACCESS_IDENTIFIER_P): Rename to
	NESTED_FIELD_ACCESS_IDENTIFIER_P.
	(FIELD_INNER_ACCESS): Rename to FIELD_NESTED_ACCESS.
	(FIELD_INNER_ACCESS_P): Rename to FIELD_NESTED_ACCESS_P.
	* jcf-write.c (generate_classfile): Use
	NESTED_FIELD_ACCESS_IDENTIFIER_P instead of
	OUTER_FIELD_ACCESS_IDENTIFIER_P.
	* parse.y (build_outer_field_access): Rename to
	build_nested_field_access. Support static fields and outer-to-inner
	class accesses.
	(outer_field_access_p): Rename to nested_field_access_p. Support
	static fields and generalise to outer-to-inner class and sibling
	inner class accesses.
	(outer_field_expanded_access_p): Rename to
	nested_field_expanded_access_p and support static fields.
	(outer_field_access_fix): Rename to nested_field_access_fix and
	support static fields.
	(build_outer_field_access_expr): Rename to
	build_nested_field_access_expr and support static fields.
	(build_outer_field_access_methods): Rename to
	build_nested_field_access_methods and support static fields. For
	static fields, generate accessors without class instance parameters.
	(build_outer_field_access_method): Rename to
	build_nested_field_access_method and support static fields.
	(build_outer_method_access_method): Use
	NESTED_FIELD_ACCESS_IDENTIFIER_P instead of
	OUTER_FIELD_ACCESS_IDENTIFIER_P.
	(resolve_expression_name): Consider static field accesses across
	nested classes.
	(resolve_qualified_expression_name): Likewise.
	(java_complete_lhs): Use nested_field_access_fix instead of
	outer_field_access_fix.
	(patch_unary_op): Rename outer_field_flag to nested_field_flag.
	Use nested_field_expanded_access_p instead of
	outer_field_expanded_access_p. Use nested_field_access_fix instead
	of outer_field_access_fix.
	(check_thrown_exceptions): Use NESTED_FIELD_ACCESS_IDENTIFIER_P
	instead of OUTER_FIELD_ACCESS_IDENTIFIER_P.

From-SVN: r100246
parent 27358466
2005-05-26 Ranjit Mathew <rmathew@hotmail.com>
PR java/19870.
* java-tree.h (OUTER_FIELD_ACCESS_IDENTIFIER_P): Rename to
NESTED_FIELD_ACCESS_IDENTIFIER_P.
(FIELD_INNER_ACCESS): Rename to FIELD_NESTED_ACCESS.
(FIELD_INNER_ACCESS_P): Rename to FIELD_NESTED_ACCESS_P.
* jcf-write.c (generate_classfile): Use
NESTED_FIELD_ACCESS_IDENTIFIER_P instead of
OUTER_FIELD_ACCESS_IDENTIFIER_P.
* parse.y (build_outer_field_access): Rename to
build_nested_field_access. Support static fields and outer-to-inner
class accesses.
(outer_field_access_p): Rename to nested_field_access_p. Support
static fields and generalise to outer-to-inner class and sibling
inner class accesses.
(outer_field_expanded_access_p): Rename to
nested_field_expanded_access_p and support static fields.
(outer_field_access_fix): Rename to nested_field_access_fix and
support static fields.
(build_outer_field_access_expr): Rename to
build_nested_field_access_expr and support static fields.
(build_outer_field_access_methods): Rename to
build_nested_field_access_methods and support static fields. For
static fields, generate accessors without class instance parameters.
(build_outer_field_access_method): Rename to
build_nested_field_access_method and support static fields.
(build_outer_method_access_method): Use
NESTED_FIELD_ACCESS_IDENTIFIER_P instead of
OUTER_FIELD_ACCESS_IDENTIFIER_P.
(resolve_expression_name): Consider static field accesses across
nested classes.
(resolve_qualified_expression_name): Likewise.
(java_complete_lhs): Use nested_field_access_fix instead of
outer_field_access_fix.
(patch_unary_op): Rename outer_field_flag to nested_field_flag.
Use nested_field_expanded_access_p instead of
outer_field_expanded_access_p. Use nested_field_access_fix instead
of outer_field_access_fix.
(check_thrown_exceptions): Use NESTED_FIELD_ACCESS_IDENTIFIER_P
instead of OUTER_FIELD_ACCESS_IDENTIFIER_P.
2005-05-26 Bryce McKinlay <mckinlay@redhat.com>
* decl.c (GCJ_BINARYCOMPAT_ADDITION,
......@@ -10461,7 +10503,7 @@
properly initialize `finished_label'. Don't emit gotos for empty
try statements.
2000-03-19 Martin v. Lwis <loewis@informatik.hu-berlin.de>
2000-03-19 Martin v. Lis <loewis@informatik.hu-berlin.de>
* except.c (emit_handlers): Clear catch_clauses_last.
......
......@@ -71,7 +71,7 @@ struct JCF;
IS_CRAFTED_STRING_BUFFER_P (in CALL_EXPR)
IS_INIT_CHECKED (in SAVE_EXPR)
6: CAN_COMPLETE_NORMALLY (in statement nodes)
OUTER_FIELD_ACCESS_IDENTIFIER_P (in IDENTIFIER_NODE)
NESTED_FIELD_ACCESS_IDENTIFIER_P (in IDENTIFIER_NODE)
Usage of TYPE_LANG_FLAG_?:
0: CLASS_ACCESS0_GENERATED_P (in RECORD_TYPE)
......@@ -896,16 +896,16 @@ union lang_tree_node
#define DECL_LOCAL_START_PC(NODE) (DECL_LANG_SPECIFIC (NODE)->u.v.start_pc)
/* The end (bytecode) pc for the valid range of this local variable. */
#define DECL_LOCAL_END_PC(NODE) (DECL_LANG_SPECIFIC (NODE)->u.v.end_pc)
/* For a VAR_DECLor PARM_DECL, used to chain decls with the same
/* For a VAR_DECL or PARM_DECL, used to chain decls with the same
slot_number in decl_map. */
#define DECL_LOCAL_SLOT_CHAIN(NODE) (DECL_LANG_SPECIFIC(NODE)->u.v.slot_chain)
/* For a FIELD_DECL, holds the name of the access method. Used to
read/write the content of the field from an inner class. */
#define FIELD_INNER_ACCESS(DECL) \
read/write the content of the field across nested class boundaries. */
#define FIELD_NESTED_ACCESS(DECL) \
(DECL_LANG_SPECIFIC (VAR_OR_FIELD_CHECK (DECL))->u.v.am)
/* Safely tests whether FIELD_INNER_ACCESS exists or not. */
#define FIELD_INNER_ACCESS_P(DECL) \
DECL_LANG_SPECIFIC (DECL) && FIELD_INNER_ACCESS (DECL)
/* Safely tests whether FIELD_NESTED_ACCESS exists or not. */
#define FIELD_NESTED_ACCESS_P(DECL) \
DECL_LANG_SPECIFIC (DECL) && FIELD_NESTED_ACCESS (DECL)
/* True if a final field was initialized upon its declaration
or in an initializer. Set after definite assignment. */
#define DECL_FIELD_FINAL_IUD(NODE) (DECL_LANG_SPECIFIC (NODE)->u.v.final_iud)
......@@ -1689,9 +1689,9 @@ extern tree *type_map;
/* True if NODE (a statement) can complete normally. */
#define CAN_COMPLETE_NORMALLY(NODE) TREE_LANG_FLAG_6 (NODE)
/* True if NODE (an IDENTIFIER) bears the name of a outer field from
inner class access function. */
#define OUTER_FIELD_ACCESS_IDENTIFIER_P(NODE) \
/* True if NODE (an IDENTIFIER) bears the name of an outer field from
inner class (or vice versa) access function. */
#define NESTED_FIELD_ACCESS_IDENTIFIER_P(NODE) \
TREE_LANG_FLAG_6 (IDENTIFIER_NODE_CHECK (NODE))
/* True if NODE belongs to an inner class TYPE_DECL node.
......
......@@ -3087,7 +3087,7 @@ generate_classfile (tree clas, struct jcf_partial *state)
/* Make room for the Synthetic attribute (of zero length.) */
if (DECL_FINIT_P (part)
|| DECL_INSTINIT_P (part)
|| OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (part))
|| NESTED_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (part))
|| TYPE_DOT_CLASS (clas) == part)
{
i++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment