Commit da7da8f9 by Richard Henderson Committed by Richard Henderson

decl.c (end_java_method): Do not save and restore flag_non_call_exceptions.

        * decl.c (end_java_method): Do not save and restore
        flag_non_call_exceptions.
        * parse.y (source_end_java_method): Likewise.
        * lang.c (flag_exceptions): Don't declare.
        (java_init_options): Set flag_non_call_exceptions.  Set
        flag_exceptions here ...
        (java_init): ... not here.

From-SVN: r40921
parent 826840d9
2001-03-28 Richard Henderson <rth@redhat.com>
* decl.c (end_java_method): Do not save and restore
flag_non_call_exceptions.
* parse.y (source_end_java_method): Likewise.
* lang.c (flag_exceptions): Don't declare.
(java_init_options): Set flag_non_call_exceptions. Set
flag_exceptions here ...
(java_init): ... not here.
2001-03-27 Richard Henderson <rth@redhat.com> 2001-03-27 Richard Henderson <rth@redhat.com>
* expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of * expr.c, parse.h: Use USING_SJLJ_EXCEPTIONS instead of
......
...@@ -1827,7 +1827,6 @@ void ...@@ -1827,7 +1827,6 @@ void
end_java_method () end_java_method ()
{ {
tree fndecl = current_function_decl; tree fndecl = current_function_decl;
int flag_flag_non_call_exceptions = flag_non_call_exceptions;
expand_end_bindings (getdecls (), 1, 0); expand_end_bindings (getdecls (), 1, 0);
/* pop out of function */ /* pop out of function */
...@@ -1843,18 +1842,10 @@ end_java_method () ...@@ -1843,18 +1842,10 @@ end_java_method ()
/* Generate rtl for function exit. */ /* Generate rtl for function exit. */
expand_function_end (input_filename, lineno, 0); expand_function_end (input_filename, lineno, 0);
/* FIXME: If the current method contains any exception handlers,
force flag_non_call_exceptions: this is necessary because signal
handlers in libjava may throw exceptions. This is far from being
a perfect solution, but it's better than doing nothing at all.*/
if (catch_clauses)
flag_non_call_exceptions = 1;
/* Run the optimizers and output assembler code for this function. */ /* Run the optimizers and output assembler code for this function. */
rest_of_compilation (fndecl); rest_of_compilation (fndecl);
current_function_decl = NULL_TREE; current_function_decl = NULL_TREE;
flag_non_call_exceptions = flag_flag_non_call_exceptions;
} }
/* Mark language-specific parts of T for garbage-collection. */ /* Mark language-specific parts of T for garbage-collection. */
......
...@@ -150,10 +150,6 @@ int flag_extraneous_semicolon; ...@@ -150,10 +150,6 @@ int flag_extraneous_semicolon;
/* When non zero, always check for a non gcj generated classes archive. */ /* When non zero, always check for a non gcj generated classes archive. */
int flag_force_classes_archive_check; int flag_force_classes_archive_check;
/* From gcc/flags.h, and indicates if exceptions are turned on or not. */
extern int flag_exceptions;
/* Table of language-dependent -f options. /* Table of language-dependent -f options.
STRING is the option name. VARIABLE is the address of the variable. STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE ON_VALUE is the value to store in VARIABLE
...@@ -655,8 +651,6 @@ java_init () ...@@ -655,8 +651,6 @@ java_init ()
print_error_function = lang_print_error; print_error_function = lang_print_error;
lang_expand_expr = java_lang_expand_expr; lang_expand_expr = java_lang_expand_expr;
flag_exceptions = 1;
/* Append to Gcc tree node definition arrays */ /* Append to Gcc tree node definition arrays */
memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE, memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
...@@ -704,6 +698,8 @@ static void ...@@ -704,6 +698,8 @@ static void
java_init_options () java_init_options ()
{ {
flag_bounds_check = 1; flag_bounds_check = 1;
flag_exceptions = 1;
flag_non_call_exceptions = 1;
} }
const char * const char *
......
...@@ -7117,7 +7117,6 @@ static void ...@@ -7117,7 +7117,6 @@ static void
source_end_java_method () source_end_java_method ()
{ {
tree fndecl = current_function_decl; tree fndecl = current_function_decl;
int flag_flag_non_call_exceptions = flag_non_call_exceptions;
if (!fndecl) if (!fndecl)
return; return;
...@@ -7153,20 +7152,12 @@ source_end_java_method () ...@@ -7153,20 +7152,12 @@ source_end_java_method ()
emit_handlers (); emit_handlers ();
expand_function_end (input_filename, lineno, 0); expand_function_end (input_filename, lineno, 0);
/* FIXME: If the current method contains any exception handlers,
force flag_non_call_exceptions: this is necessary because signal
handlers in libjava may throw exceptions. This is far from being
a perfect solution, but it's better than doing nothing at all.*/
if (catch_clauses)
flag_non_call_exceptions = 1;
/* Run the optimizers and output assembler code for this function. */ /* Run the optimizers and output assembler code for this function. */
rest_of_compilation (fndecl); rest_of_compilation (fndecl);
} }
current_function_decl = NULL_TREE; current_function_decl = NULL_TREE;
java_parser_context_restore_global (); java_parser_context_restore_global ();
flag_non_call_exceptions = flag_flag_non_call_exceptions;
} }
/* Record EXPR in the current function block. Complements compound /* Record EXPR in the current function block. Complements compound
......
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