Extensive changes.

�
Extensive changes.  See ChangeLog.

From-SVN: r23621
This commit is contained in:
Per Bothner 1998-11-12 08:15:18 -08:00
parent 1247285492
commit 15fdcfe952
5 changed files with 393 additions and 370 deletions

View File

@ -191,16 +191,13 @@ java.install-info:
java.mostlyclean:
-rm -f java/*$(objext) $(DEMANGLER_PROG)
# CYGNUS LOCAL - Delete these files here instead of in realclean because they
# are now created in the build subdirectories.
-rm -f java/parse.c java/parse-scan.c java/parse.output java/y.tab.c
java.clean:
java.distclean:
-rm -f java/config.status java/Makefile
-rm -f java/parse.output
java.extraclean:
java.maintainer-clean:
-rm -f java/parse.c java/parse-scan.c java/parse.output java/y.tab.c
# Stage hooks:
# The main makefile has already created stage?/java.

View File

@ -431,6 +431,8 @@ init_decl_processing ()
TREE_TYPE (size_zero_node) = sizetype;
size_one_node = build_int_2 (1, 0);
TREE_TYPE (size_one_node) = sizetype;
/* Used by the parser to represent empty statements and blocks. */
CAN_COMPLETE_NORMALLY (size_zero_node) = 1;
byte_type_node = make_signed_type (8);
pushdecl (build_decl (TYPE_DECL, get_identifier ("byte"), byte_type_node));

View File

@ -1337,9 +1337,7 @@ build_known_method_ref (method, method_type, self_type, method_signature, arg_li
tree method, method_type, self_type, method_signature, arg_list;
{
tree func;
if (flag_emit_class_files)
return method;
else if (is_compiled_class (self_type))
if (is_compiled_class (self_type))
{
make_decl_rtl (method, NULL, 1);
func = build1 (ADDR_EXPR, method_ptr_type_node, method);
@ -1696,6 +1694,18 @@ load_type_state (label)
type_map [i] = TREE_VEC_ELT (vec, i);
}
/* Do the expansion of a Java switch. With Gcc, switches are front-end
dependant things, but they rely on gcc routines. This function is
placed here because it uses things defined locally in parse.y. */
static tree
case_identity (t, v)
tree t __attribute__ ((__unused__));
tree v;
{
return v;
}
struct rtx_def *
java_lang_expand_expr (exp, target, tmode, modifier)
register tree exp;
@ -1716,6 +1726,7 @@ java_lang_expand_expr (exp, target, tmode, modifier)
if (BLOCK_EXPR_BODY (exp))
{
tree local;
tree body = BLOCK_EXPR_BODY (exp);
struct rtx_def *to_return;
pushlevel (2); /* 2 and above */
expand_start_bindings (0);
@ -1727,16 +1738,41 @@ java_lang_expand_expr (exp, target, tmode, modifier)
expand_decl (pushdecl (local));
local = next;
}
to_return =
expand_expr (BLOCK_EXPR_BODY (exp), target, tmode, modifier);
/* Avoid deep recursion for long block. */
while (TREE_CODE (body) == COMPOUND_EXPR)
{
expand_expr (TREE_OPERAND (body, 0), const0_rtx, VOIDmode, 0);
body = TREE_OPERAND (body, 1);
}
to_return = expand_expr (body, target, tmode, modifier);
poplevel (1, 1, 0);
expand_end_bindings (getdecls (), 1, 0);
return to_return;
}
break;
case CASE_EXPR:
{
tree duplicate;
if (pushcase (TREE_OPERAND (exp, 0), case_identity,
build_decl (LABEL_DECL, NULL_TREE, NULL_TREE), &duplicate) == 2)
{
EXPR_WFL_LINECOL (wfl_operator) = EXPR_WFL_LINECOL (exp);
parse_error_context
(wfl_operator, "Duplicate case label: `%s'",
print_int_node (TREE_OPERAND (exp, 0)));
}
return const0_rtx;
}
case DEFAULT_EXPR:
pushcase (NULL_TREE, 0, build_decl (LABEL_DECL, NULL_TREE, NULL_TREE), NULL);
return const0_rtx;
case SWITCH_EXPR:
java_expand_switch (exp);
expand_start_case (0, TREE_OPERAND (exp, 0), int_type_node, "switch");
expand_expr_stmt (TREE_OPERAND (exp, 1));
expand_end_case (TREE_OPERAND (exp, 0));
return const0_rtx;
case TRY_EXPR:

View File

@ -439,6 +439,9 @@ static jdeplist *reverse_jdep_list ();
#define BLOCK_EXPR_DECLS(NODE) BLOCK_VARS(NODE)
#define BLOCK_EXPR_BODY(NODE) BLOCK_SUBBLOCKS(NODE)
/* For an artificial BLOCK (created to house a local variable declaration not
at the start of an existing block), the parent block; otherwise NULL. */
#define BLOCK_EXPR_ORIGIN(NODE) BLOCK_ABSTRACT_ORIGIN(NODE)
/* Merge an other line to the source line number of a decl. Used to
@ -601,7 +604,7 @@ struct parser_ctxt {
tree import_list; /* List of import */
tree import_demand_list; /* List of import on demand */
tree current_loop; /* List of the currently nested loops */
tree current_loop; /* List of the currently nested loops/switches */
tree current_labeled_block; /* List of currently nested
labeled blocks. */
@ -618,7 +621,6 @@ struct parser_ctxt {
/* Functions declarations */
#ifndef JC1_LITE
static char *java_accstring_lookup PROTO ((int));
static void parse_error PROTO ((char *));
static void classitf_redefinition_error PROTO ((char *,tree, tree, tree));
static void variable_redefinition_error PROTO ((tree, tree, tree, int));
static void check_modifiers PROTO ((char *, int, int));
@ -637,9 +639,8 @@ static tree lookup_java_method2 PROTO ((tree, tree, int));
static tree method_header PROTO ((int, tree, tree, tree));
static void fix_method_argument_names PROTO ((tree ,tree));
static tree method_declarator PROTO ((tree, tree));
static void parse_error_context VPROTO ((tree cl, char *msg, ...));
static void parse_warning_context VPROTO ((tree cl, char *msg, ...));
static void issue_warning_error_from_context PROTO ((tree, char *msg));
static void issue_warning_error_from_context PROTO ((tree, char *msg, va_list));
static tree parse_jdk1_1_error PROTO ((char *));
static void complete_class_report_errors PROTO ((jdep *));
static int process_imports PROTO ((void));
@ -662,8 +663,8 @@ static tree resolve_expression_name PROTO ((tree, tree *));
static tree maybe_create_class_interface_decl PROTO ((tree, tree, tree));
static int check_class_interface_creation PROTO ((int, int, tree,
tree, tree, tree));
static tree patch_method_invocation_stmt PROTO ((tree, tree, tree,
int *, tree *, int));
static tree patch_method_invocation PROTO ((tree, tree, tree,
int *, tree *, int));
static int breakdown_qualified PROTO ((tree *, tree *, tree));
static tree resolve_and_layout PROTO ((tree, tree));
static tree resolve_no_layout PROTO ((tree, tree));

File diff suppressed because it is too large Load Diff