Commit 951120ea by Paul Brook Committed by Paul Brook

dwarf2out.c (dwarf2out_begin_prologue): Rename IA64_UNWIND_INFO to TARGET_UNWIND_INFO.

	* dwarf2out.c (dwarf2out_begin_prologue): Rename IA64_UNWIND_INFO
	to TARGET_UNWIND_INFO.
	* except.c (output_function_exception_table): Ditto.
	* except.h: Ditto.
	* opts.c (decode_options): Ditto.
	* passes.c (rest_of_handle_final): Ditto.
	* final.c (final_start_function): Ditto.
	(final_scan_insn, final_scan_insn): Replace IA64_UNWIND_EMIT with
	target hook.
	* targhooks.h (default_unwind_emit): Declare.
	* targhooks.c (default_unwind_emit): New function.
	* target-def.h: Define and use TARGET_UNWIND_EMIT.
	* target.h (struct gcc_target): Add unwind_emit.
	* config/ia64/ia64.c (TARGET_UNWIND_EMIT): Define.
	* config/ia64/ia64.h: Rename IA64_UNWIND_INFO to TARGET_UNWIND_INFO.
	Remove IA64_UNWIND_EMIT.
	* doc/tm.texi: Document TARGET_UNWIND_EMIT and TARGET_UNWIND_INFO.

From-SVN: r84734
parent b845ed9f
2004-07-15 Paul Brook <paul@codesourcery.com>
* dwarf2out.c (dwarf2out_begin_prologue): Rename IA64_UNWIND_INFO
to TARGET_UNWIND_INFO.
* except.c (output_function_exception_table): Ditto.
* except.h: Ditto.
* opts.c (decode_options): Ditto.
* passes.c (rest_of_handle_final): Ditto.
* final.c (final_start_function): Ditto.
(final_scan_insn, final_scan_insn): Replace IA64_UNWIND_EMIT with
target hook.
* targhooks.h (default_unwind_emit): Declare.
* targhooks.c (default_unwind_emit): New function.
* target-def.h: Define and use TARGET_UNWIND_EMIT.
* target.h (struct gcc_target): Add unwind_emit.
* config/ia64/ia64.c (TARGET_UNWIND_EMIT): Define.
* config/ia64/ia64.h: Rename IA64_UNWIND_INFO to TARGET_UNWIND_INFO.
Remove IA64_UNWIND_EMIT.
* doc/tm.texi: Document TARGET_UNWIND_EMIT and TARGET_UNWIND_INFO.
2004-07-14 Richard Henderson <rth@redhat.com> 2004-07-14 Richard Henderson <rth@redhat.com>
* print-tree.c (print_node): Handle SSA_NAME. * print-tree.c (print_node): Handle SSA_NAME.
......
...@@ -416,6 +416,9 @@ static const struct attribute_spec ia64_attribute_table[] = ...@@ -416,6 +416,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_GIMPLIFY_VA_ARG_EXPR #undef TARGET_GIMPLIFY_VA_ARG_EXPR
#define TARGET_GIMPLIFY_VA_ARG_EXPR ia64_gimplify_va_arg #define TARGET_GIMPLIFY_VA_ARG_EXPR ia64_gimplify_va_arg
#undef TARGET_UNWIND_EMIT
#define TARGET_UNWIND_EMIT process_for_unwind_directive
struct gcc_target targetm = TARGET_INITIALIZER; struct gcc_target targetm = TARGET_INITIALIZER;
/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */ /* Return 1 if OP is a valid operand for the MEM of a CALL insn. */
......
...@@ -2265,8 +2265,7 @@ do { \ ...@@ -2265,8 +2265,7 @@ do { \
extern int ia64_final_schedule; extern int ia64_final_schedule;
#define IA64_UNWIND_INFO 1 #define TARGET_UNWIND_INFO 1
#define IA64_UNWIND_EMIT(f,i) process_for_unwind_directive (f,i)
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM) #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)
......
...@@ -7503,6 +7503,11 @@ true if this is a placeholder label for an omitted FDE. ...@@ -7503,6 +7503,11 @@ true if this is a placeholder label for an omitted FDE.
The default is that FDEs are not given nonlocal labels. The default is that FDEs are not given nonlocal labels.
@end deftypefn @end deftypefn
@deftypefn {Taget Hook} void TARGET_UNWIND_EMIT (FILE * @var{stream}, rtx @var{insn})
This target hook emits and assembly directives required to unwind the
given instruction. This is only used when TARGET_UNWIND_INFO is set.
@end deftypefn
@node Exception Region Output @node Exception Region Output
@subsection Assembler Commands for Exception Regions @subsection Assembler Commands for Exception Regions
...@@ -7552,6 +7557,11 @@ If this macro is defined to anything, the DWARF 2 unwinder will be used ...@@ -7552,6 +7557,11 @@ If this macro is defined to anything, the DWARF 2 unwinder will be used
instead of inline unwinders and @code{__unwind_function} in the non-@code{setjmp} case. instead of inline unwinders and @code{__unwind_function} in the non-@code{setjmp} case.
@end defmac @end defmac
@defmac TARGET_UNWIND_INFO
Define this macro if your target has ABI specified unwind tables. Usually
these will be output by @code{TARGET_UNWIND_EMIT}.
@end defmac
@defmac MUST_USE_SJLJ_EXCEPTIONS @defmac MUST_USE_SJLJ_EXCEPTIONS
This macro need only be defined if @code{DWARF2_UNWIND_INFO} is This macro need only be defined if @code{DWARF2_UNWIND_INFO} is
runtime-variable. In that case, @file{except.h} cannot correctly runtime-variable. In that case, @file{except.h} cannot correctly
......
...@@ -2360,7 +2360,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, ...@@ -2360,7 +2360,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
current_function_func_begin_label = 0; current_function_func_begin_label = 0;
#ifdef IA64_UNWIND_INFO #ifdef TARGET_UNWIND_INFO
/* ??? current_function_func_begin_label is also used by except.c /* ??? current_function_func_begin_label is also used by except.c
for call-site information. We must emit this label if it might for call-site information. We must emit this label if it might
be used. */ be used. */
...@@ -2379,7 +2379,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, ...@@ -2379,7 +2379,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
current_function_funcdef_no); current_function_funcdef_no);
current_function_func_begin_label = get_identifier (label); current_function_func_begin_label = get_identifier (label);
#ifdef IA64_UNWIND_INFO #ifdef TARGET_UNWIND_INFO
/* We can elide the fde allocation if we're not emitting debug info. */ /* We can elide the fde allocation if we're not emitting debug info. */
if (! dwarf2out_do_frame ()) if (! dwarf2out_do_frame ())
return; return;
......
...@@ -3598,7 +3598,8 @@ output_function_exception_table (void) ...@@ -3598,7 +3598,8 @@ output_function_exception_table (void)
if (! cfun->uses_eh_lsda) if (! cfun->uses_eh_lsda)
return; return;
#ifdef IA64_UNWIND_INFO #ifdef TARGET_UNWIND_INFO
/* TODO: Move this into target file. */
fputs ("\t.personality\t", asm_out_file); fputs ("\t.personality\t", asm_out_file);
output_addr_const (asm_out_file, eh_personality_libfunc); output_addr_const (asm_out_file, eh_personality_libfunc);
fputs ("\n\t.handlerdata\n", asm_out_file); fputs ("\n\t.handlerdata\n", asm_out_file);
......
...@@ -130,7 +130,7 @@ extern tree (*lang_eh_runtime_type) (tree); ...@@ -130,7 +130,7 @@ extern tree (*lang_eh_runtime_type) (tree);
#ifndef MUST_USE_SJLJ_EXCEPTIONS #ifndef MUST_USE_SJLJ_EXCEPTIONS
# if !(defined (EH_RETURN_DATA_REGNO) \ # if !(defined (EH_RETURN_DATA_REGNO) \
&& (defined (IA64_UNWIND_INFO) \ && (defined (TARGET_UNWIND_INFO) \
|| (DWARF2_UNWIND_INFO \ || (DWARF2_UNWIND_INFO \
&& (defined (EH_RETURN_HANDLER_RTX) \ && (defined (EH_RETURN_HANDLER_RTX) \
|| defined (HAVE_eh_return))))) || defined (HAVE_eh_return)))))
...@@ -152,8 +152,8 @@ extern tree (*lang_eh_runtime_type) (tree); ...@@ -152,8 +152,8 @@ extern tree (*lang_eh_runtime_type) (tree);
# if !defined(EH_RETURN_HANDLER_RTX) && !defined(HAVE_eh_return) # if !defined(EH_RETURN_HANDLER_RTX) && !defined(HAVE_eh_return)
#error "EH_RETURN_HANDLER_RTX or eh_return required" #error "EH_RETURN_HANDLER_RTX or eh_return required"
# endif # endif
# if !defined(DWARF2_UNWIND_INFO) && !defined(IA64_UNWIND_INFO) # if !defined(DWARF2_UNWIND_INFO) && !defined(TARGET_UNWIND_INFO)
#error "{DWARF2,IA64}_UNWIND_INFO required" #error "{DWARF2,TARGET}_UNWIND_INFO required"
# endif # endif
# endif # endif
#else #else
......
...@@ -1347,7 +1347,7 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file, ...@@ -1347,7 +1347,7 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
(*debug_hooks->begin_prologue) (last_linenum, last_filename); (*debug_hooks->begin_prologue) (last_linenum, last_filename);
#if defined (DWARF2_UNWIND_INFO) || defined (IA64_UNWIND_INFO) #if defined (DWARF2_UNWIND_INFO) || defined (TARGET_UNWIND_INFO)
if (write_symbols != DWARF2_DEBUG && write_symbols != VMS_AND_DWARF2_DEBUG) if (write_symbols != DWARF2_DEBUG && write_symbols != VMS_AND_DWARF2_DEBUG)
dwarf2out_begin_prologue (0, NULL); dwarf2out_begin_prologue (0, NULL);
#endif #endif
...@@ -1732,9 +1732,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -1732,9 +1732,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
&& !scan_ahead_for_unlikely_executed_note (insn)) && !scan_ahead_for_unlikely_executed_note (insn))
text_section (); text_section ();
#ifdef IA64_UNWIND_INFO #ifdef TARGET_UNWIND_INFO
IA64_UNWIND_EMIT (asm_out_file, insn); targetm.asm_out.unwind_emit (asm_out_file, insn);
#endif #endif
if (flag_debug_asm) if (flag_debug_asm)
fprintf (asm_out_file, "\t%s basic block %d\n", fprintf (asm_out_file, "\t%s basic block %d\n",
ASM_COMMENT_START, NOTE_BASIC_BLOCK (insn)->index); ASM_COMMENT_START, NOTE_BASIC_BLOCK (insn)->index);
...@@ -2525,11 +2526,14 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, ...@@ -2525,11 +2526,14 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
if (prescan > 0) if (prescan > 0)
break; break;
#ifdef IA64_UNWIND_INFO #ifdef TARGET_UNWIND_INFO
IA64_UNWIND_EMIT (asm_out_file, insn); /* ??? This will put the directives in the wrong place if
get_insn_template outputs assembly directly. However calling it
before get_insn_template breaks if the insns is split. */
targetm.asm_out.unwind_emit (asm_out_file, insn);
#endif #endif
/* Output assembler code from the template. */
/* Output assembler code from the template. */
output_asm_insn (template, recog_data.operand); output_asm_insn (template, recog_data.operand);
/* If necessary, report the effect that the instruction has on /* If necessary, report the effect that the instruction has on
......
...@@ -578,10 +578,10 @@ decode_options (unsigned int argc, const char **argv) ...@@ -578,10 +578,10 @@ decode_options (unsigned int argc, const char **argv)
target_flags = 0; target_flags = 0;
set_target_switch (""); set_target_switch ("");
/* Unwind tables are always present in an ABI-conformant IA-64 /* Unwind tables are always present when a target has ABI-specified unwind
object file, so the default should be ON. */ tables, so the default should be ON. */
#ifdef IA64_UNWIND_INFO #ifdef TARGET_UNWIND_INFO
flag_unwind_tables = IA64_UNWIND_INFO; flag_unwind_tables = TARGET_UNWIND_INFO;
#endif #endif
#ifdef OPTIMIZATION_OPTIONS #ifdef OPTIMIZATION_OPTIONS
......
...@@ -457,7 +457,7 @@ rest_of_handle_final (void) ...@@ -457,7 +457,7 @@ rest_of_handle_final (void)
final (get_insns (), asm_out_file, optimize, 0); final (get_insns (), asm_out_file, optimize, 0);
final_end_function (); final_end_function ();
#ifdef IA64_UNWIND_INFO #ifdef TARGET_UNWIND_INFO
/* ??? The IA-64 ".handlerdata" directive must be issued before /* ??? The IA-64 ".handlerdata" directive must be issued before
the ".endp" directive that closes the procedure descriptor. */ the ".endp" directive that closes the procedure descriptor. */
output_function_exception_table (); output_function_exception_table ();
...@@ -465,7 +465,7 @@ rest_of_handle_final (void) ...@@ -465,7 +465,7 @@ rest_of_handle_final (void)
assemble_end_function (current_function_decl, fnname); assemble_end_function (current_function_decl, fnname);
#ifndef IA64_UNWIND_INFO #ifndef TARGET_UNWIND_INFO
/* Otherwise, it feels unclean to switch sections in the middle. */ /* Otherwise, it feels unclean to switch sections in the middle. */
output_function_exception_table (); output_function_exception_table ();
#endif #endif
......
...@@ -62,6 +62,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -62,6 +62,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_ASM_EMIT_UNWIND_LABEL default_emit_unwind_label #define TARGET_ASM_EMIT_UNWIND_LABEL default_emit_unwind_label
#endif #endif
#ifndef TARGET_UNWIND_EMIT
#define TARGET_UNWIND_EMIT default_unwind_emit
#endif
#ifndef TARGET_ASM_INTERNAL_LABEL #ifndef TARGET_ASM_INTERNAL_LABEL
#define TARGET_ASM_INTERNAL_LABEL default_internal_label #define TARGET_ASM_INTERNAL_LABEL default_internal_label
#endif #endif
...@@ -195,6 +199,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -195,6 +199,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ASM_INTEGER, \ TARGET_ASM_INTEGER, \
TARGET_ASM_GLOBALIZE_LABEL, \ TARGET_ASM_GLOBALIZE_LABEL, \
TARGET_ASM_EMIT_UNWIND_LABEL, \ TARGET_ASM_EMIT_UNWIND_LABEL, \
TARGET_UNWIND_EMIT, \
TARGET_ASM_INTERNAL_LABEL, \ TARGET_ASM_INTERNAL_LABEL, \
TARGET_ASM_ASSEMBLE_VISIBILITY, \ TARGET_ASM_ASSEMBLE_VISIBILITY, \
TARGET_ASM_FUNCTION_PROLOGUE, \ TARGET_ASM_FUNCTION_PROLOGUE, \
......
...@@ -85,6 +85,9 @@ struct gcc_target ...@@ -85,6 +85,9 @@ struct gcc_target
this is only a placeholder for an omitted FDE. */ this is only a placeholder for an omitted FDE. */
void (* unwind_label) (FILE *, tree, int, int); void (* unwind_label) (FILE *, tree, int, int);
/* Emit any directives required to unwind this instruction. */
void (* unwind_emit) (FILE *, rtx);
/* Output an internal label. */ /* Output an internal label. */
void (* internal_label) (FILE *, const char *, unsigned long); void (* internal_label) (FILE *, const char *, unsigned long);
......
...@@ -190,3 +190,14 @@ hook_pass_by_reference_must_pass_in_stack (CUMULATIVE_ARGS *c ATTRIBUTE_UNUSED, ...@@ -190,3 +190,14 @@ hook_pass_by_reference_must_pass_in_stack (CUMULATIVE_ARGS *c ATTRIBUTE_UNUSED,
{ {
return targetm.calls.must_pass_in_stack (mode, type); return targetm.calls.must_pass_in_stack (mode, type);
} }
/* Emit any directives required to unwind this instruction. */
void
default_unwind_emit (FILE * stream ATTRIBUTE_UNUSED,
rtx insn ATTRIBUTE_UNUSED)
{
/* Should never happen. */
abort ();
}
...@@ -39,3 +39,5 @@ extern bool hook_pass_by_reference_false ...@@ -39,3 +39,5 @@ extern bool hook_pass_by_reference_false
(CUMULATIVE_ARGS *, enum machine_mode mode, tree, bool); (CUMULATIVE_ARGS *, enum machine_mode mode, tree, bool);
extern bool hook_pass_by_reference_must_pass_in_stack extern bool hook_pass_by_reference_must_pass_in_stack
(CUMULATIVE_ARGS *, enum machine_mode mode, tree, bool); (CUMULATIVE_ARGS *, enum machine_mode mode, tree, bool);
extern void default_unwind_emit (FILE *, rtx);
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