Commit 9d7d8362 by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

[multiple changes]

2001-07-18  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (create_interface): Avoid cyclic inheritance report when
	syntax error encountered during class definition.
	Fixes PR java/2956

2001-07-17  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.h (INTERFACE_INNER_MODIFIERS): Disallow `private.'
	* parse.y (check_class_interface_creation): Allow `private' if the
	enclosing is not an interface.
	(create_interface): Interface tagged public if the enclosing
	context	is an interface.
	(create_class): Class tagged public if the enclosing context
	is an interface.
	Fixes PR java/2959

2001-07-17  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* class.c (push_class): Set DECL_SIZE to `integer_zero_node.'
	Fixes PR java/2665

2001-07-13  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (java_complete_lsh): Set CAN_COMPLETE_NORMALLY and unset
	TREE_CONSTANT_OVERFLOW of CASE_EXPR value.
	Fixes PR java/3602

(http://gcc.gnu.org/ml/gcc-patches/2001-07/msg02297.html )

From-SVN: r44524
parent 6d0f55e6
2001-07-18 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (create_interface): Avoid cyclic inheritance report when
syntax error encountered during class definition.
Fixes PR java/2956
2001-07-18 Tom Tromey <tromey@redhat.com> 2001-07-18 Tom Tromey <tromey@redhat.com>
For PR java/2812: For PR java/2812:
...@@ -7,10 +13,32 @@ ...@@ -7,10 +13,32 @@
* Make-lang.in (jc1$(exeext)): Link against LIBICONV. * Make-lang.in (jc1$(exeext)): Link against LIBICONV.
(jv-scan$(exeext)): Likewise. (jv-scan$(exeext)): Likewise.
2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.h (INTERFACE_INNER_MODIFIERS): Disallow `private.'
* parse.y (check_class_interface_creation): Allow `private' if the
enclosing is not an interface.
(create_interface): Interface tagged public if the enclosing
context is an interface.
(create_class): Class tagged public if the enclosing context
is an interface.
Fixes PR java/2959
2001-07-17 Alexandre Petit-Bianco <apbianco@redhat.com>
* class.c (push_class): Set DECL_SIZE to `integer_zero_node.'
Fixes PR java/2665
2001-07-14 Tim Josling <tej@melbpc.org.au> 2001-07-14 Tim Josling <tej@melbpc.org.au>
* check-init.c (check_init): Remove references to EXPON_EXPR. * check-init.c (check_init): Remove references to EXPON_EXPR.
2001-07-13 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (java_complete_lsh): Set CAN_COMPLETE_NORMALLY and unset
TREE_CONSTANT_OVERFLOW of CASE_EXPR value.
Fixes PR java/3602
2001-07-13 Tom Tromey <tromey@redhat.com> 2001-07-13 Tom Tromey <tromey@redhat.com>
* jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1 * jvspec.c (jvgenmain_spec): Remove -ffilelist-file from cc1
......
...@@ -331,6 +331,10 @@ push_class (class_type, class_name) ...@@ -331,6 +331,10 @@ push_class (class_type, class_name)
input_filename = IDENTIFIER_POINTER (source_name); input_filename = IDENTIFIER_POINTER (source_name);
lineno = 0; lineno = 0;
decl = build_decl (TYPE_DECL, class_name, class_type); decl = build_decl (TYPE_DECL, class_name, class_type);
/* dbxout needs a DECL_SIZE if in gstabs mode */
DECL_SIZE (decl) = integer_zero_node;
input_filename = save_input_filename; input_filename = save_input_filename;
lineno = save_lineno; lineno = save_lineno;
signature = identifier_subst (class_name, "L", '.', '/', ";"); signature = identifier_subst (class_name, "L", '.', '/', ";");
......
...@@ -79,7 +79,7 @@ extern tree stabilize_reference PARAMS ((tree)); ...@@ -79,7 +79,7 @@ extern tree stabilize_reference PARAMS ((tree));
#define METHOD_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_PRIVATE|ACC_ABSTRACT| \ #define METHOD_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_PRIVATE|ACC_ABSTRACT| \
ACC_STATIC|ACC_FINAL|ACC_SYNCHRONIZED|ACC_NATIVE ACC_STATIC|ACC_FINAL|ACC_SYNCHRONIZED|ACC_NATIVE
#define INTERFACE_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT #define INTERFACE_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT
#define INTERFACE_INNER_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_PRIVATE|ACC_ABSTRACT|ACC_STATIC #define INTERFACE_INNER_MODIFIERS ACC_PUBLIC|ACC_PROTECTED|ACC_ABSTRACT|ACC_STATIC
#define INTERFACE_METHOD_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT #define INTERFACE_METHOD_MODIFIERS ACC_PUBLIC|ACC_ABSTRACT
#define INTERFACE_FIELD_MODIFIERS ACC_PUBLIC|ACC_STATIC|ACC_FINAL #define INTERFACE_FIELD_MODIFIERS ACC_PUBLIC|ACC_STATIC|ACC_FINAL
......
...@@ -3450,7 +3450,9 @@ check_class_interface_creation (is_interface, flags, raw_name, qualified_name, d ...@@ -3450,7 +3450,9 @@ check_class_interface_creation (is_interface, flags, raw_name, qualified_name, d
else else
{ {
check_modifiers_consistency (flags); check_modifiers_consistency (flags);
icaf = ACC_PRIVATE|ACC_PROTECTED; icaf = ACC_PROTECTED;
if (! CLASS_INTERFACE (GET_CPC ()))
icaf |= ACC_PRIVATE;
} }
} }
...@@ -3738,6 +3740,11 @@ create_interface (flags, id, super) ...@@ -3738,6 +3740,11 @@ create_interface (flags, id, super)
tree q_name = parser_qualified_classname (raw_name); tree q_name = parser_qualified_classname (raw_name);
tree decl = IDENTIFIER_CLASS_VALUE (q_name); tree decl = IDENTIFIER_CLASS_VALUE (q_name);
/* Certain syntax errors are making SUPER be like ID. Avoid this
case. */
if (ctxp->class_err && id == super)
super = NULL;
EXPR_WFL_NODE (id) = q_name; /* Keep source location, even if refined. */ EXPR_WFL_NODE (id) = q_name; /* Keep source location, even if refined. */
/* Basic checks: scope, redefinition, modifiers */ /* Basic checks: scope, redefinition, modifiers */
...@@ -3750,7 +3757,12 @@ create_interface (flags, id, super) ...@@ -3750,7 +3757,12 @@ create_interface (flags, id, super)
/* Suspend the current parsing context if we're parsing an inner /* Suspend the current parsing context if we're parsing an inner
interface */ interface */
if (CPC_INNER_P ()) if (CPC_INNER_P ())
{
java_parser_context_suspend (); java_parser_context_suspend ();
/* Interface members are public. */
if (CLASS_INTERFACE (GET_CPC ()))
flags |= ACC_PUBLIC;
}
/* Push a new context for (static) initialized upon declaration fields */ /* Push a new context for (static) initialized upon declaration fields */
java_parser_context_push_initialized_field (); java_parser_context_push_initialized_field ();
...@@ -3870,6 +3882,11 @@ create_class (flags, id, super, interfaces) ...@@ -3870,6 +3882,11 @@ create_class (flags, id, super, interfaces)
tree class_id, decl; tree class_id, decl;
tree super_decl_type; tree super_decl_type;
/* Certain syntax errors are making SUPER be like ID. Avoid this
case. */
if (ctxp->class_err && id == super)
super = NULL;
class_id = parser_qualified_classname (raw_name); class_id = parser_qualified_classname (raw_name);
decl = IDENTIFIER_CLASS_VALUE (class_id); decl = IDENTIFIER_CLASS_VALUE (class_id);
EXPR_WFL_NODE (id) = class_id; EXPR_WFL_NODE (id) = class_id;
...@@ -3884,7 +3901,13 @@ create_class (flags, id, super, interfaces) ...@@ -3884,7 +3901,13 @@ create_class (flags, id, super, interfaces)
/* Suspend the current parsing context if we're parsing an inner /* Suspend the current parsing context if we're parsing an inner
class or an anonymous class. */ class or an anonymous class. */
if (CPC_INNER_P ()) if (CPC_INNER_P ())
{
java_parser_context_suspend (); java_parser_context_suspend ();
/* Interface members are public. */
if (CLASS_INTERFACE (GET_CPC ()))
flags |= ACC_PUBLIC;
}
/* Push a new context for (static) initialized upon declaration fields */ /* Push a new context for (static) initialized upon declaration fields */
java_parser_context_push_initialized_field (); java_parser_context_push_initialized_field ();
...@@ -7336,6 +7359,8 @@ java_reorder_fields () ...@@ -7336,6 +7359,8 @@ java_reorder_fields ()
} }
} }
} }
/* There are cases were gclass_list will be empty. */
if (gclass_list)
stop_reordering = TREE_TYPE (TREE_VALUE (gclass_list)); stop_reordering = TREE_TYPE (TREE_VALUE (gclass_list));
} }
...@@ -11367,6 +11392,8 @@ java_complete_lhs (node) ...@@ -11367,6 +11392,8 @@ java_complete_lhs (node)
} }
cn = fold (convert (int_type_node, cn)); cn = fold (convert (int_type_node, cn));
TREE_CONSTANT_OVERFLOW (cn) = 0;
CAN_COMPLETE_NORMALLY (cn) = 1;
/* Multiple instance of a case label bearing the same /* Multiple instance of a case label bearing the same
value is checked during code generation. The case value is checked during code generation. The case
......
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