diff options
author | Jason Merrill <jason@casey.cygnus.com> | 2000-03-08 23:05:30 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-03-08 18:05:30 -0500 |
commit | 737faf1404678b40cb1f5dcf2ca816d2872fb347 (patch) | |
tree | 9cd029cae289371cef51ff6c9c21a855f0f74e53 /gcc/dwarf2out.c | |
parent | 602b1b13d794eb93a93c5fd52bfd4191c8dae9c0 (diff) | |
download | gcc-737faf1404678b40cb1f5dcf2ca816d2872fb347.tar.gz |
dwarf2out.c (dw_fde_struct): Add 'nothrow'.
* dwarf2out.c (dw_fde_struct): Add 'nothrow'.
(dwarf2out_begin_prologue): Set it.
(output_call_frame_info): Don't emit EH unwind info for leaves.
From-SVN: r32434
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index a44162e30e2..20e8a1be4bd 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -129,6 +129,7 @@ typedef struct dw_fde_struct char *dw_fde_current_label; char *dw_fde_end; dw_cfi_ref dw_fde_cfi; + int nothrow; } dw_fde_node; @@ -1624,6 +1625,17 @@ output_call_frame_info (for_eh) /* Do we want to include a pointer to the exception table? */ int eh_ptr = for_eh && exception_table_p (); + /* If we don't have any functions we'll want to unwind out of, don't + emit any EH unwind information. */ + if (for_eh) + { + for (i = 0; i < fde_table_in_use; ++i) + if (! fde_table[i].nothrow) + goto found; + return; + found:; + } + fputc ('\n', asm_out_file); /* We're going to be generating comments, so turn on app. */ @@ -1756,6 +1768,10 @@ output_call_frame_info (for_eh) { fde = &fde_table[i]; + /* Don't emit EH unwind info for leaf functions. */ + if (for_eh && fde->nothrow) + continue; + ASM_GENERATE_INTERNAL_LABEL (l1, FDE_AFTER_SIZE_LABEL, for_eh + i*2); ASM_GENERATE_INTERNAL_LABEL (l2, FDE_END_LABEL, for_eh + i*2); #ifdef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL @@ -1874,6 +1890,9 @@ dwarf2out_begin_prologue () fde->dw_fde_end = NULL; fde->dw_fde_cfi = NULL; + /* Normally, only calls can throw, so a leaf function will never throw. */ + fde->nothrow = (current_function_is_leaf && !asynchronous_exceptions); + args_size = old_args_size = 0; } |