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
This commit is contained in:
Paul Brook 2004-07-15 01:07:53 +00:00 committed by Paul Brook
parent b845ed9ff8
commit 951120eabf
14 changed files with 78 additions and 20 deletions

View File

@ -1,3 +1,23 @@
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>
* print-tree.c (print_node): Handle SSA_NAME.

View File

@ -416,6 +416,9 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_GIMPLIFY_VA_ARG_EXPR
#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;
/* Return 1 if OP is a valid operand for the MEM of a CALL insn. */

View File

@ -2265,8 +2265,7 @@ do { \
extern int ia64_final_schedule;
#define IA64_UNWIND_INFO 1
#define IA64_UNWIND_EMIT(f,i) process_for_unwind_directive (f,i)
#define TARGET_UNWIND_INFO 1
#define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 15 : INVALID_REGNUM)

View File

@ -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.
@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
@subsection Assembler Commands for Exception Regions
@ -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.
@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
This macro need only be defined if @code{DWARF2_UNWIND_INFO} is
runtime-variable. In that case, @file{except.h} cannot correctly

View File

@ -2360,7 +2360,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
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
for call-site information. We must emit this label if it might
be used. */
@ -2379,7 +2379,7 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
current_function_funcdef_no);
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. */
if (! dwarf2out_do_frame ())
return;

View File

@ -3598,7 +3598,8 @@ output_function_exception_table (void)
if (! cfun->uses_eh_lsda)
return;
#ifdef IA64_UNWIND_INFO
#ifdef TARGET_UNWIND_INFO
/* TODO: Move this into target file. */
fputs ("\t.personality\t", asm_out_file);
output_addr_const (asm_out_file, eh_personality_libfunc);
fputs ("\n\t.handlerdata\n", asm_out_file);

View File

@ -130,7 +130,7 @@ extern tree (*lang_eh_runtime_type) (tree);
#ifndef MUST_USE_SJLJ_EXCEPTIONS
# if !(defined (EH_RETURN_DATA_REGNO) \
&& (defined (IA64_UNWIND_INFO) \
&& (defined (TARGET_UNWIND_INFO) \
|| (DWARF2_UNWIND_INFO \
&& (defined (EH_RETURN_HANDLER_RTX) \
|| defined (HAVE_eh_return)))))
@ -152,8 +152,8 @@ extern tree (*lang_eh_runtime_type) (tree);
# if !defined(EH_RETURN_HANDLER_RTX) && !defined(HAVE_eh_return)
#error "EH_RETURN_HANDLER_RTX or eh_return required"
# endif
# if !defined(DWARF2_UNWIND_INFO) && !defined(IA64_UNWIND_INFO)
#error "{DWARF2,IA64}_UNWIND_INFO required"
# if !defined(DWARF2_UNWIND_INFO) && !defined(TARGET_UNWIND_INFO)
#error "{DWARF2,TARGET}_UNWIND_INFO required"
# endif
# endif
#else

View File

@ -1347,7 +1347,7 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
(*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)
dwarf2out_begin_prologue (0, NULL);
#endif
@ -1732,9 +1732,10 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
&& !scan_ahead_for_unlikely_executed_note (insn))
text_section ();
#ifdef IA64_UNWIND_INFO
IA64_UNWIND_EMIT (asm_out_file, insn);
#ifdef TARGET_UNWIND_INFO
targetm.asm_out.unwind_emit (asm_out_file, insn);
#endif
if (flag_debug_asm)
fprintf (asm_out_file, "\t%s basic block %d\n",
ASM_COMMENT_START, NOTE_BASIC_BLOCK (insn)->index);
@ -2525,11 +2526,14 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
if (prescan > 0)
break;
#ifdef IA64_UNWIND_INFO
IA64_UNWIND_EMIT (asm_out_file, insn);
#ifdef TARGET_UNWIND_INFO
/* ??? 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
/* Output assembler code from the template. */
/* Output assembler code from the template. */
output_asm_insn (template, recog_data.operand);
/* If necessary, report the effect that the instruction has on

View File

@ -578,10 +578,10 @@ decode_options (unsigned int argc, const char **argv)
target_flags = 0;
set_target_switch ("");
/* Unwind tables are always present in an ABI-conformant IA-64
object file, so the default should be ON. */
#ifdef IA64_UNWIND_INFO
flag_unwind_tables = IA64_UNWIND_INFO;
/* Unwind tables are always present when a target has ABI-specified unwind
tables, so the default should be ON. */
#ifdef TARGET_UNWIND_INFO
flag_unwind_tables = TARGET_UNWIND_INFO;
#endif
#ifdef OPTIMIZATION_OPTIONS

View File

@ -457,7 +457,7 @@ rest_of_handle_final (void)
final (get_insns (), asm_out_file, optimize, 0);
final_end_function ();
#ifdef IA64_UNWIND_INFO
#ifdef TARGET_UNWIND_INFO
/* ??? The IA-64 ".handlerdata" directive must be issued before
the ".endp" directive that closes the procedure descriptor. */
output_function_exception_table ();
@ -465,7 +465,7 @@ rest_of_handle_final (void)
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. */
output_function_exception_table ();
#endif

View File

@ -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
#endif
#ifndef TARGET_UNWIND_EMIT
#define TARGET_UNWIND_EMIT default_unwind_emit
#endif
#ifndef TARGET_ASM_INTERNAL_LABEL
#define TARGET_ASM_INTERNAL_LABEL default_internal_label
#endif
@ -195,6 +199,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ASM_INTEGER, \
TARGET_ASM_GLOBALIZE_LABEL, \
TARGET_ASM_EMIT_UNWIND_LABEL, \
TARGET_UNWIND_EMIT, \
TARGET_ASM_INTERNAL_LABEL, \
TARGET_ASM_ASSEMBLE_VISIBILITY, \
TARGET_ASM_FUNCTION_PROLOGUE, \

View File

@ -85,6 +85,9 @@ struct gcc_target
this is only a placeholder for an omitted FDE. */
void (* unwind_label) (FILE *, tree, int, int);
/* Emit any directives required to unwind this instruction. */
void (* unwind_emit) (FILE *, rtx);
/* Output an internal label. */
void (* internal_label) (FILE *, const char *, unsigned long);

View File

@ -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);
}
/* Emit any directives required to unwind this instruction. */
void
default_unwind_emit (FILE * stream ATTRIBUTE_UNUSED,
rtx insn ATTRIBUTE_UNUSED)
{
/* Should never happen. */
abort ();
}

View File

@ -39,3 +39,5 @@ extern bool hook_pass_by_reference_false
(CUMULATIVE_ARGS *, enum machine_mode mode, tree, bool);
extern bool hook_pass_by_reference_must_pass_in_stack
(CUMULATIVE_ARGS *, enum machine_mode mode, tree, bool);
extern void default_unwind_emit (FILE *, rtx);