parse.y (dump_java_tree): New function.

* parse.y (dump_java_tree): New function.
	(source_end_java_method): Call it.
	(end_class_declaration): Likewise.
	* lang.c (java_decode_option): Call dump_switch_p.

From-SVN: r48439
This commit is contained in:
Tom Tromey 2002-01-01 01:42:15 +00:00 committed by Tom Tromey
parent f95e79cc11
commit 12cfb4fc72
3 changed files with 37 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2001-12-31 Tom Tromey <tromey@redhat.com>
* parse.y (dump_java_tree): New function.
(source_end_java_method): Call it.
(end_class_declaration): Likewise.
* lang.c (java_decode_option): Call dump_switch_p.
2001-12-28 Tom Tromey <tromey@redhat.com>
* gen-table.pl: Don't process characters after \uffff. Added

View file

@ -340,8 +340,10 @@ java_decode_option (argc, argv)
P's value is the option sans `-f'.
Search for it in the table of options. */
p += 2;
return process_option_with_no (p, lang_f_options,
ARRAY_SIZE (lang_f_options));
if (process_option_with_no (p, lang_f_options,
ARRAY_SIZE (lang_f_options)))
return 1;
return dump_switch_p (p);
}
if (strcmp (p, "-Wall") == 0)

View file

@ -108,6 +108,7 @@ static tree resolve_package PARAMS ((tree, tree *));
static tree lookup_package_type PARAMS ((const char *, int));
static tree resolve_class PARAMS ((tree, tree, tree, tree));
static void declare_local_variables PARAMS ((int, tree, tree));
static void dump_java_tree PARAMS ((enum tree_dump_index, tree));
static void source_start_java_method PARAMS ((tree));
static void source_end_java_method PARAMS ((void));
static tree find_name_in_single_imports PARAMS ((tree));
@ -4060,6 +4061,9 @@ end_class_declaration (resume)
popped by a resume. */
int no_error_occurred = ctxp->next && GET_CPC () != error_mark_node;
if (GET_CPC () != error_mark_node)
dump_java_tree (TDI_class, GET_CPC ());
java_parser_context_pop_initialized_field ();
POP_CPC ();
if (resume && no_error_occurred)
@ -7391,6 +7395,24 @@ end_artificial_method_body (mdecl)
exit_block ();
}
/* Dump a tree of some kind. This is a convenience wrapper for the
dump_* functions in tree-dump.c. */
static void
dump_java_tree (phase, t)
enum tree_dump_index phase;
tree t;
{
FILE *stream;
int flags;
stream = dump_begin (phase, &flags);
if (stream)
{
dump_node (t, flags, stream);
dump_end (phase, stream);
}
}
/* Terminate a function and expand its body. */
static void
@ -7410,6 +7432,10 @@ source_end_java_method ()
if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)) == empty_stmt_node)
BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl)) = NULL_TREE;
/* We've generated all the trees for this function, and it has been
patched. Dump it to a file if the user requested it. */
dump_java_tree (TDI_original, fndecl);
/* Generate function's code */
if (BLOCK_EXPR_BODY (DECL_FUNCTION_BODY (fndecl))
&& ! flag_emit_class_files