Commit bf43101e by Mark Mitchell Committed by Mark Mitchell

except.c (expand_eh_region_start_for_decl): Use NOTE_EH_HANDLER, not NOTE_BLOCK_NUMBER.

	* except.c (expand_eh_region_start_for_decl): Use NOTE_EH_HANDLER,
	not NOTE_BLOCK_NUMBER.
	(expand_eh_region_end): Likewise.
	(find_exception_handler_labels): Likewise.
	(scan_region): Likewise.
	(exception_optimize): Likewise.
	(update_rethrow_references): Likewise.
	(set_insn_eh_region): Likewise.
	* final.c (final_scan_insn): Likewise.
	* flow.c (make_edges): Likewise.
	* integrate.c (expand_inline_function): Likewise.
	* print-rtl.c (print_rtx): Likewise.

From-SVN: r29418
parent 8411a903
Tue Sep 14 16:47:08 1999 Mark Mitchell <mark@codesourcery.com>
* except.c (expand_eh_region_start_for_decl): Use NOTE_EH_HANDLER,
not NOTE_BLOCK_NUMBER.
(expand_eh_region_end): Likewise.
(find_exception_handler_labels): Likewise.
(scan_region): Likewise.
(exception_optimize): Likewise.
(update_rethrow_references): Likewise.
(set_insn_eh_region): Likewise.
* final.c (final_scan_insn): Likewise.
* flow.c (make_edges): Likewise.
* integrate.c (expand_inline_function): Likewise.
* print-rtl.c (print_rtx): Likewise.
Tue Sep 14 16:30:16 1999 Richard Henderson <rth@cygnus.com> Tue Sep 14 16:30:16 1999 Richard Henderson <rth@cygnus.com>
* ginclude/stdarg.h, ginclude/varargs.h: Implement in * ginclude/stdarg.h, ginclude/varargs.h: Implement in
......
...@@ -1437,7 +1437,7 @@ expand_eh_region_start_for_decl (decl) ...@@ -1437,7 +1437,7 @@ expand_eh_region_start_for_decl (decl)
push_eh_entry (&ehstack); push_eh_entry (&ehstack);
note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_BEG); note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_BEG);
NOTE_BLOCK_NUMBER (note) NOTE_EH_HANDLER (note)
= CODE_LABEL_NUMBER (ehstack.top->entry->exception_handler_label); = CODE_LABEL_NUMBER (ehstack.top->entry->exception_handler_label);
if (exceptions_via_longjmp) if (exceptions_via_longjmp)
start_dynamic_handler (); start_dynamic_handler ();
...@@ -1476,7 +1476,7 @@ expand_eh_region_end (handler) ...@@ -1476,7 +1476,7 @@ expand_eh_region_end (handler)
entry = pop_eh_entry (&ehstack); entry = pop_eh_entry (&ehstack);
note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_END); note = emit_note (NULL_PTR, NOTE_INSN_EH_REGION_END);
ret = NOTE_BLOCK_NUMBER (note) ret = NOTE_EH_HANDLER (note)
= CODE_LABEL_NUMBER (entry->exception_handler_label); = CODE_LABEL_NUMBER (entry->exception_handler_label);
if (exceptions_via_longjmp == 0 && ! flag_new_exceptions if (exceptions_via_longjmp == 0 && ! flag_new_exceptions
/* We share outer_context between regions; only emit it once. */ /* We share outer_context between regions; only emit it once. */
...@@ -1498,7 +1498,7 @@ expand_eh_region_end (handler) ...@@ -1498,7 +1498,7 @@ expand_eh_region_end (handler)
entry->finalization = handler; entry->finalization = handler;
/* create region entry in final exception table */ /* create region entry in final exception table */
r = new_eh_region_entry (NOTE_BLOCK_NUMBER (note), entry->rethrow_label); r = new_eh_region_entry (NOTE_EH_HANDLER (note), entry->rethrow_label);
enqueue_eh_entry (&ehqueue, entry); enqueue_eh_entry (&ehqueue, entry);
...@@ -2018,7 +2018,7 @@ static int eh_table_max_size = 0; ...@@ -2018,7 +2018,7 @@ static int eh_table_max_size = 0;
Called from final_scan_insn when a NOTE_INSN_EH_REGION_BEG is seen. Called from final_scan_insn when a NOTE_INSN_EH_REGION_BEG is seen.
(Or NOTE_INSN_EH_REGION_END sometimes) (Or NOTE_INSN_EH_REGION_END sometimes)
N is the NOTE_BLOCK_NUMBER of the note, which comes from the code N is the NOTE_EH_HANDLER of the note, which comes from the code
label number of the exception handler for the region. */ label number of the exception handler for the region. */
void void
...@@ -2289,7 +2289,7 @@ find_exception_handler_labels () ...@@ -2289,7 +2289,7 @@ find_exception_handler_labels ()
if (GET_CODE (insn) == NOTE if (GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
{ {
ptr = get_first_handler (NOTE_BLOCK_NUMBER (insn)); ptr = get_first_handler (NOTE_EH_HANDLER (insn));
for ( ; ptr; ptr = ptr->next) for ( ; ptr; ptr = ptr->next)
{ {
/* make sure label isn't in the list already */ /* make sure label isn't in the list already */
...@@ -2560,7 +2560,7 @@ scan_region (insn, n, delete_outer) ...@@ -2560,7 +2560,7 @@ scan_region (insn, n, delete_outer)
if (insn == NULL_RTX if (insn == NULL_RTX
|| GET_CODE (insn) != NOTE || GET_CODE (insn) != NOTE
|| NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG || NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
|| NOTE_BLOCK_NUMBER (insn) != n || NOTE_EH_HANDLER (insn) != n
|| delete_outer == NULL) || delete_outer == NULL)
abort (); abort ();
...@@ -2580,14 +2580,14 @@ scan_region (insn, n, delete_outer) ...@@ -2580,14 +2580,14 @@ scan_region (insn, n, delete_outer)
if (GET_CODE (insn) == NOTE if (GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) && NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
{ {
insn = scan_region (insn, NOTE_BLOCK_NUMBER (insn), &delete); insn = scan_region (insn, NOTE_EH_HANDLER (insn), &delete);
} }
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
} }
/* The _BEG/_END NOTEs must match and nest. */ /* The _BEG/_END NOTEs must match and nest. */
if (NOTE_BLOCK_NUMBER (insn) != n) if (NOTE_EH_HANDLER (insn) != n)
abort (); abort ();
/* If anything in this exception region can throw, we can throw. */ /* If anything in this exception region can throw, we can throw. */
...@@ -2665,7 +2665,7 @@ exception_optimize () ...@@ -2665,7 +2665,7 @@ exception_optimize ()
inbetween. We are also guaranteed that the value of insn inbetween. We are also guaranteed that the value of insn
returned will be valid, as otherwise scan_region won't returned will be valid, as otherwise scan_region won't
return. */ return. */
insn = scan_region (insn, NOTE_BLOCK_NUMBER (insn), &n); insn = scan_region (insn, NOTE_EH_HANDLER (insn), &n);
} }
} }
} }
...@@ -2706,7 +2706,7 @@ update_rethrow_references () ...@@ -2706,7 +2706,7 @@ update_rethrow_references ()
{ {
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
{ {
region = find_func_region (NOTE_BLOCK_NUMBER (insn)); region = find_func_region (NOTE_EH_HANDLER (insn));
saw_region[region] = 1; saw_region[region] = 1;
} }
} }
...@@ -2946,10 +2946,10 @@ set_insn_eh_region (first, region_num) ...@@ -2946,10 +2946,10 @@ set_insn_eh_region (first, region_num)
for (insn = *first; insn; insn = NEXT_INSN (insn)) for (insn = *first; insn; insn = NEXT_INSN (insn))
{ {
if ((GET_CODE (insn) == NOTE) && if ((GET_CODE (insn) == NOTE)
(NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)) && (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG))
{ {
rnum = NOTE_BLOCK_NUMBER (insn); rnum = NOTE_EH_HANDLER (insn);
insn_eh_region[INSN_UID (insn)] = rnum; insn_eh_region[INSN_UID (insn)] = rnum;
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
set_insn_eh_region (&insn, rnum); set_insn_eh_region (&insn, rnum);
...@@ -3147,12 +3147,12 @@ init_eh_nesting_info () ...@@ -3147,12 +3147,12 @@ init_eh_nesting_info ()
{ {
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG) if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG)
{ {
int block = NOTE_BLOCK_NUMBER (insn); int block = NOTE_EH_HANDLER (insn);
region_count++; region_count++;
info->region_index[block] = region_count; info->region_index[block] = region_count;
if (eh_note) if (eh_note)
nested_eh_region [block] = nested_eh_region [block] =
NOTE_BLOCK_NUMBER (XEXP (eh_note, 0)); NOTE_EH_HANDLER (XEXP (eh_note, 0));
else else
nested_eh_region [block] = 0; nested_eh_region [block] = 0;
eh_note = gen_rtx_EXPR_LIST (VOIDmode, insn, eh_note); eh_note = gen_rtx_EXPR_LIST (VOIDmode, insn, eh_note);
......
...@@ -2099,11 +2099,11 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -2099,11 +2099,11 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_BEG
&& ! exceptions_via_longjmp) && ! exceptions_via_longjmp)
{ {
ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_BLOCK_NUMBER (insn)); ASM_OUTPUT_INTERNAL_LABEL (file, "LEHB", NOTE_EH_HANDLER (insn));
if (! flag_new_exceptions) if (! flag_new_exceptions)
add_eh_table_entry (NOTE_BLOCK_NUMBER (insn)); add_eh_table_entry (NOTE_EH_HANDLER (insn));
#ifdef ASM_OUTPUT_EH_REGION_BEG #ifdef ASM_OUTPUT_EH_REGION_BEG
ASM_OUTPUT_EH_REGION_BEG (file, NOTE_BLOCK_NUMBER (insn)); ASM_OUTPUT_EH_REGION_BEG (file, NOTE_EH_HANDLER (insn));
#endif #endif
break; break;
} }
...@@ -2111,11 +2111,11 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes) ...@@ -2111,11 +2111,11 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END if (NOTE_LINE_NUMBER (insn) == NOTE_INSN_EH_REGION_END
&& ! exceptions_via_longjmp) && ! exceptions_via_longjmp)
{ {
ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_BLOCK_NUMBER (insn)); ASM_OUTPUT_INTERNAL_LABEL (file, "LEHE", NOTE_EH_HANDLER (insn));
if (flag_new_exceptions) if (flag_new_exceptions)
add_eh_table_entry (NOTE_BLOCK_NUMBER (insn)); add_eh_table_entry (NOTE_EH_HANDLER (insn));
#ifdef ASM_OUTPUT_EH_REGION_END #ifdef ASM_OUTPUT_EH_REGION_END
ASM_OUTPUT_EH_REGION_END (file, NOTE_BLOCK_NUMBER (insn)); ASM_OUTPUT_EH_REGION_END (file, NOTE_EH_HANDLER (insn));
#endif #endif
break; break;
} }
......
...@@ -990,7 +990,7 @@ make_edges (label_value_list, bb_eh_end) ...@@ -990,7 +990,7 @@ make_edges (label_value_list, bb_eh_end)
int num; int num;
if (eh_list) if (eh_list)
eh_region = NOTE_BLOCK_NUMBER (XEXP (eh_list, 0)); eh_region = NOTE_EH_HANDLER (XEXP (eh_list, 0));
num = reachable_handlers (eh_region, eh_nest_info, num = reachable_handlers (eh_region, eh_nest_info,
insn, &handler_list); insn, &handler_list);
......
...@@ -1217,7 +1217,7 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -1217,7 +1217,7 @@ expand_inline_function (fndecl, parms, target, ignore, type,
|| NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END)) || NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_END))
{ {
rtx label rtx label
= get_label_from_map (map, NOTE_BLOCK_NUMBER (copy)); = get_label_from_map (map, NOTE_EH_HANDLER (copy));
/* we have to duplicate the handlers for the original */ /* we have to duplicate the handlers for the original */
if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG) if (NOTE_LINE_NUMBER (copy) == NOTE_INSN_EH_REGION_BEG)
...@@ -1225,14 +1225,14 @@ expand_inline_function (fndecl, parms, target, ignore, type, ...@@ -1225,14 +1225,14 @@ expand_inline_function (fndecl, parms, target, ignore, type,
/* We need to duplicate the handlers for the EH region /* We need to duplicate the handlers for the EH region
and we need to indicate where the label map is */ and we need to indicate where the label map is */
eif_eh_map = map; eif_eh_map = map;
duplicate_eh_handlers (NOTE_BLOCK_NUMBER (copy), duplicate_eh_handlers (NOTE_EH_HANDLER (copy),
CODE_LABEL_NUMBER (label), CODE_LABEL_NUMBER (label),
expand_inline_function_eh_labelmap); expand_inline_function_eh_labelmap);
} }
/* We have to forward these both to match the new exception /* We have to forward these both to match the new exception
region. */ region. */
NOTE_BLOCK_NUMBER (copy) = CODE_LABEL_NUMBER (label); NOTE_EH_HANDLER (copy) = CODE_LABEL_NUMBER (label);
} }
} }
else else
......
...@@ -162,9 +162,13 @@ print_rtx (in_rtx) ...@@ -162,9 +162,13 @@ print_rtx (in_rtx)
if (i == 3 && GET_CODE (in_rtx) == NOTE) if (i == 3 && GET_CODE (in_rtx) == NOTE)
{ {
if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_BEG if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_BEG
|| NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_END || NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_EH_REGION_END)
|| NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_BEG {
|| NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_END) fprintf (outfile, " %d", NOTE_EH_HANDLER (in_rtx));
sawclose = 1;
}
else if (NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_BEG
|| NOTE_LINE_NUMBER (in_rtx) == NOTE_INSN_BLOCK_END)
{ {
fprintf (outfile, " %d", NOTE_BLOCK_NUMBER (in_rtx)); fprintf (outfile, " %d", NOTE_BLOCK_NUMBER (in_rtx));
sawclose = 1; sawclose = 1;
......
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