diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-07 20:50:17 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-09-07 20:50:17 +0000 |
commit | 379666996538e12cd735fe6e66ccf7b53583027e (patch) | |
tree | 41a92d71cf2cb5360f756b8179c661cc2aee74ec /gcc/except.c | |
parent | 8bb151fa06a4b2d39a8af22fea86c1ad76801718 (diff) | |
download | gcc-379666996538e12cd735fe6e66ccf7b53583027e.tar.gz |
Hookize exception personality output.
* target.def (TARGET_ASM_EMIT_EXCEPT_PERSONALITY): New hook.
* doc/tm.texi.in: Add doc marker.
* doc/tm.texi: Rebuild.
* except.c (switch_to_exception_section): Always build.
(output_one_function_exception_table): Move section switch,
personality output, and label output ...
(output_function_exception_table): ... here. Use the new
personality hook.
* config/ia64/ia64.c (ia64_asm_emit_except_personality,
ia64_asm_init_sections, TARGET_ASM_EMIT_EXCEPT_PERSONALITY,
TARGET_ASM_INIT_SECTIONS): New.
(ia64_asm_unwind_emit): Rename from process_for_unwind_directive,
make static.
(TARGET_ASM_UNWIND_EMIT): Update to match.
* config/ia64/ia64-protos.h (process_for_unwind_directive): Remove.
* config/arm/arm.c (arm_asm_emit_except_personality): New.
(arm_asm_init_sections): New.
(TARGET_ASM_EMIT_EXCEPT_PERSONALITY, TARGET_ASM_INIT_SECTIONS): New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163968 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/except.c')
-rw-r--r-- | gcc/except.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/gcc/except.c b/gcc/except.c index 0df1996124b..bfffa447d9c 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -2794,7 +2794,6 @@ sjlj_output_call_site_table (void) call_site_base += n; } -#ifndef TARGET_UNWIND_INFO /* Switch to the section that should be used for exception tables. */ static void @@ -2844,7 +2843,6 @@ switch_to_exception_section (const char * ARG_UNUSED (fnname)) switch_to_section (s); } -#endif /* Output a reference from an exception table to the type_info object TYPE. @@ -2904,8 +2902,7 @@ output_ttype (tree type, int tt_format, int tt_format_size) } static void -output_one_function_exception_table (const char * ARG_UNUSED (fnname), - int section, rtx ARG_UNUSED (personality)) +output_one_function_exception_table (int section) { int tt_format, cs_format, lp_format, i; #ifdef HAVE_AS_LEB128 @@ -2918,20 +2915,6 @@ output_one_function_exception_table (const char * ARG_UNUSED (fnname), int have_tt_data; int tt_format_size = 0; -#ifdef TARGET_UNWIND_INFO - /* TODO: Move this into target file. */ - fputs ("\t.personality\t", asm_out_file); - output_addr_const (asm_out_file, personality); - fputs ("\n\t.handlerdata\n", asm_out_file); - /* Note that varasm still thinks we're in the function's code section. - The ".endp" directive that will immediately follow will take us back. */ -#else - switch_to_exception_section (fnname); -#endif - - /* If the target wants a label to begin the table, emit it here. */ - targetm.asm_out.emit_except_table_label (asm_out_file); - have_tt_data = (VEC_length (tree, cfun->eh->ttype_data) || (targetm.arm_eabi_unwinder ? VEC_length (tree, cfun->eh->ehspec_data.arm_eabi) @@ -3095,7 +3078,7 @@ output_one_function_exception_table (const char * ARG_UNUSED (fnname), } void -output_function_exception_table (const char * ARG_UNUSED (fnname)) +output_function_exception_table (const char *fnname) { rtx personality = get_personality_function (current_function_decl); @@ -3104,11 +3087,21 @@ output_function_exception_table (const char * ARG_UNUSED (fnname)) return; if (personality) - assemble_external_libcall (personality); + { + assemble_external_libcall (personality); + + if (targetm.asm_out.emit_except_personality) + targetm.asm_out.emit_except_personality (personality); + } + + switch_to_exception_section (fnname); + + /* If the target wants a label to begin the table, emit it here. */ + targetm.asm_out.emit_except_table_label (asm_out_file); - output_one_function_exception_table (fnname, 0, personality); + output_one_function_exception_table (0); if (crtl->eh.call_site_record[1] != NULL) - output_one_function_exception_table (fnname, 1, personality); + output_one_function_exception_table (1); switch_to_section (current_function_section ()); } |