diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2011-04-01 17:35:13 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2011-04-01 17:35:13 +0000 |
commit | 722279e41f7d76fc4b3ea8cca0d542c3d5779db2 (patch) | |
tree | 532d37509c7c76c048160bbd1881315d0f778614 /gcc/dwarf2out.c | |
parent | 1ca1dad5f178ee1d9d7a611254728b7748b4eb08 (diff) | |
download | gcc-722279e41f7d76fc4b3ea8cca0d542c3d5779db2.zip gcc-722279e41f7d76fc4b3ea8cca0d542c3d5779db2.tar.gz gcc-722279e41f7d76fc4b3ea8cca0d542c3d5779db2.tar.bz2 |
dwarf2out.h (dwarf2out_frame_debug_init): Declare.
* dwarf2out.h (dwarf2out_frame_debug_init): Declare.
* dwarf2out.c (dwarf2out_frame_debug_init): New function, broken
out of ...
(dwarf2out_frame_debug): ... here. Don't handle a NULL argument.
* final.c (final_start_function): Call the new function rather
than using a NULL argument for dwarf2out_frame_debug.
From-SVN: r171839
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 4b7afe4..8371b5e 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -2788,38 +2788,6 @@ dwarf2out_frame_debug (rtx insn, bool after_p) rtx note, n; bool handled_one = false; - if (insn == NULL_RTX) - { - size_t i; - - /* Flush any queued register saves. */ - dwarf2out_flush_queued_reg_saves (); - - /* Set up state for generating call frame debug info. */ - lookup_cfa (&cfa); - gcc_assert (cfa.reg - == (unsigned long)DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM)); - - cfa.reg = STACK_POINTER_REGNUM; - cfa_store = cfa; - cfa_temp.reg = -1; - cfa_temp.offset = 0; - - for (i = 0; i < num_regs_saved_in_regs; i++) - { - regs_saved_in_regs[i].orig_reg = NULL_RTX; - regs_saved_in_regs[i].saved_in_reg = NULL_RTX; - } - num_regs_saved_in_regs = 0; - - if (barrier_args_size) - { - XDELETEVEC (barrier_args_size); - barrier_args_size = NULL; - } - return; - } - if (!NONJUMP_INSN_P (insn) || clobbers_queued_reg_save (insn)) dwarf2out_flush_queued_reg_saves (); @@ -2937,6 +2905,40 @@ dwarf2out_frame_debug (rtx insn, bool after_p) dwarf2out_flush_queued_reg_saves (); } +/* Called once at the start of final to initialize some data for the + current function. */ +void +dwarf2out_frame_debug_init (void) +{ + size_t i; + + /* Flush any queued register saves. */ + dwarf2out_flush_queued_reg_saves (); + + /* Set up state for generating call frame debug info. */ + lookup_cfa (&cfa); + gcc_assert (cfa.reg + == (unsigned long)DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM)); + + cfa.reg = STACK_POINTER_REGNUM; + cfa_store = cfa; + cfa_temp.reg = -1; + cfa_temp.offset = 0; + + for (i = 0; i < num_regs_saved_in_regs; i++) + { + regs_saved_in_regs[i].orig_reg = NULL_RTX; + regs_saved_in_regs[i].saved_in_reg = NULL_RTX; + } + num_regs_saved_in_regs = 0; + + if (barrier_args_size) + { + XDELETEVEC (barrier_args_size); + barrier_args_size = NULL; + } +} + /* Determine if we need to save and restore CFI information around this epilogue. If SIBCALL is true, then this is a sibcall epilogue. If we do need to save/restore, then emit the save now, and insert a |