1. 09 Jul, 2011 2 commits
  2. 08 Jul, 2011 34 commits
  3. 07 Jul, 2011 4 commits
    • dwarf2out: Convert fde_table to a VEC. · a518b996
      Prepare for allocating the FDE for the current function earlier
      than dwarf2out_begin_prologue.
      
              * dwarf2out.c (fde_table, fde_table_allocated, fde_table_in_use,
              FDE_TABLE_INCREMENT): Replace with...
              (fde_vec): ... this, a new vector.
              (current_fde): Remove.  Replace all users with cfun->fde.
              (output_call_frame_info): Use FOR_EACH_VEC_ELT over fde_vec.
              (size_of_aranges, dwarf2out_finish): Likewise.
              (dwarf2out_alloc_current_fde): Break out from ...
              (dwarf2out_begin_prologue): ... here.
              (dwarf2out_frame_init): Remove.
              * dwarf2cfi.c: Update all users of current_fde.
              (dwarf2out_frame_init): Rename from dwarf2cfi_frame_init.
              * dwarf2out.h: Update decls.
              (dw_fde_node): Add fde_index member.
              * function.h (struct function): Add fde member.
      
      From-SVN: r176018
      Richard Henderson committed
    • dwarf2out: Emit NOTE_INSN_CFI_* both with and without cfi-asm. · 89e25f95
      This patch is essentially Bernd's 006-cfilabel patch, updated
      for all the other changes to dwarf2out.
      
      The patch reduces the difference between the cfi-asm and non-cfi-asm
      code paths.  We now emit the CFI notes in all cases.  Later, after we're
      done producing the CFI insns we need, another pass over the rtl adds
      the necessary labels and set_loc/advance_loc CFIs.  One consequence of
      this is that def_cfa_1 can no longer use lookup_cfa, so it just compares
      to an old_cfa variable instead.
      
      The major change since Bernd's patch is that all the target-specific
      changes are no longer necessary.
      
              * dwarf2cfi.c (add_cfi): Remove.
              (dwarf2out_cfi_label): Remove force argument.  Only generate the
              label name.
              (add_fde_cfi): Simplify the different code paths.
              (add_cie_cfi): New.
              (old_cfa, old_cfa_remember): New.
              (def_cfa_1, reg_save): Remove label, add for_cie parameter.
              (last_reg_save_label): Remove.
              (dwarf2out_args_size, dwarf2out_stack_adjust, queue_reg_save,
              dwarf2out_frame_debug_def_cfa, dwarf2out_frame_debug_adjust_cfa,
              dwarf2out_frame_debug_cfa_offset, dwarf2out_frame_debug_cfa_register,
              dwarf2out_frame_debug_cfa_expression,
              dwarf2out_frame_debug_cfa_restore,
              dwarf2out_frame_debug_cfa_window_save,
              dwarf2out_frame_debug_expr): Remove label parameter.
              (cfi_label_required_p, add_cfis_to_fde): New.
              (dwarf2out_frame_debug_after_prologue): New.
              (dwarf2cfi_frame_init): Initialize old_cfa.
              (dwarf2out_frame_debug_restore_state): Likewise.
              * dwarf2out.c (dwarf2out_emit_cfi): Only do output for cfi_asm.
              (dwarf2out_switch_text_section): Don't clear dw_fde_current_label here.
              * final.c (final_start_function): Call
              dwarf2out_frame_debug_after_prologue.
      
      Co-Authored-By: Richard Henderson <rth@redhat.com>
      
      From-SVN: r176017
      Bernd Schmidt committed
    • dwarf2out: Move insn scanning out of final.c. · bc5612ed
      This patch is essentially Bernd's 005-scanfirst patch, updated for
      the introduction of the dwarf2cfi.c file.
      
      We introduce NOTE_INSN_CFI and NOTE_INSN_CFI_LABEL to hold the dwarf2
      info during the bulk of final.  The actual construction of these notes
      still happens during final, right at the very beginning of the pass,
      via the dwarf2out_frame_debug_init hook.
      
              * dwarf2cfi.c (cfi_insn): New.
              (dwarf2out_cfi_label): Don't emit cfi label here.
              (add_fde_cfi): Create a NOTE_INSN_CFI.
              (dwarf2out_frame_debug): Setup cfi_insn.
              (dwarf2out_frame_debug_init): Loop over insns creating CFI notes.
              (dwarf2out_cfi_begin_epilogue): Make static.
              (dwarf2out_frame_debug_restore_state): Make static.
              * dwarf2out.c (output_cfi_directive): Make static.
              (dwarf2out_emit_cfi): New.
              * dwarf2out.h: Update.
              * final.c (final): Remove CFI notes.
              (final_scan_insn): Don't call dwarf2out_cfi_begin_epilogue,
              dwarf2out_frame_debug_restore_state, dwarf2out_frame_debug.
              Handle NOTE_INSN_CFI and NOTE_INSN_CFI_LABEL.
              * insn-notes.def (NOTE_INSN_CFI): New.
              (NOTE_INSN_CFI_LABEL): New.
              * rtl.h (union rtunion_def): Add rt_cfi member.
              (XCFI, XCCFI, NOTE_CFI, NOTE_LABEL_NUMBER): New.
      
      Co-Authored-By: Richard Henderson <rth@redhat.com>
      
      From-SVN: r176016
      Bernd Schmidt committed
    • dwarf2out: Split CFI construction routines into a new file. · 647a1567
      Excepting changing some functions from static to extern, this
      patch contains code motion only.  The split is not very clean
      at this point, but will be refined as CFI construction is turned
      into its own proper pass.
      
              * dwarf2cfi.c: New file.
              * Makefile.in (OBJS): Add it.
              (GTFILES): Add dwarf2cfi.c and dwarf2out.h.
              * gengtype.c (open_base_files): Include dwarf2out.h.
              * coretypes.h (enum var_init_status): Move from ...
              * rtl.h: ... here.
              * dwarf2out.c (saved_do_cfi_asm, dwarf2out_do_frame,
              dwarf2out_do_cfi_asm, cie_cfi_vec, dwarf2out_cfi_label_num,
              expand_builtin_dwarf_sp_column, init_return_column_size,
              expand_builtin_init_dwarf_reg_sizes, new_cfi, add_cfi,
              dwarf2out_cfi_label, emit_cfa_remember, any_cfis_emitted, add_fde_cfi,
              lookup_cfa_1, lookup_cfa, cfa, cfa_store, cfa_remember, args_size,
              old_args_size, cfa_equal_p, def_cfa_1, reg_save, initial_return_save,
              stack_adjust_offset, barrier_args_size, compute_barrier_args_size_1,
              compute_barrier_args_size, dwarf2out_args_size,
              dwarf2out_stack_adjust, dwarf2out_notice_stack_adjust,
              queued_reg_saves, reg_saved_in_data, regs_saved_in_regs,
              compare_reg_or_pc, record_reg_saved_in_reg, last_reg_save_label,
              queue_reg_save, dwarf2out_flush_queued_reg_saves,
              clobbers_queued_reg_save, reg_saved_in, cfa_temp,
              dwarf2out_frame_debug_def_cfa, dwarf2out_frame_debug_adjust_cfa,
              dwarf2out_frame_debug_cfa_offset, dwarf2out_frame_debug_cfa_register,
              dwarf2out_frame_debug_cfa_expression,
              dwarf2out_frame_debug_cfa_restore,
              dwarf2out_frame_debug_cfa_window_save, dwarf2out_frame_debug_expr,
              dwarf2out_frame_debug, dwarf2out_frame_debug_init,
              dwarf2out_cfi_begin_epilogue, dwarf2out_frame_debug_restore_state,
              get_cfa_from_loc_descr): Move to dwarf2cfi.c.
              (dw_cfi_ref, dw_fde_ref, dw_cfi_oprnd_ref, enum dw_cfi_oprnd_type,
              dw_cfi_oprnd, dw_cfi_node, cfi_vec, dw_cfa_location, dw_fde_node,
              dw_val_ref, dw_die_ref, const_dw_die_ref, dw_loc_descr_ref,
              dw_loc_list_ref, enum dw_val_class, dw_vec_const, dw_val_node,
              dw_loc_descr_node): Move to dwarf2out.h.
              (current_fde, output_cfi_directive, build_cfa_loc, get_address_mode,
              mem_loc_descriptor): Export.
              (build_cfa_aligned_loc): Export.  Take CFA as a parameter.
              (dwarf2out_frame_init): Extract CIE generation code to
              dwarf2cfi_frame_init.
      
      From-SVN: r176015
      Richard Henderson committed