aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-07-15 08:34:46 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-07-15 08:34:46 +0000
commite2a12aca42db7657d00b43ef76606e208159273d (patch)
tree3f39c7aa98569361a789583a5906c27e2596de19 /gcc/final.c
parentbe7b80f42726389bd25888ede4f13d276bb12ef0 (diff)
downloadgcc-e2a12aca42db7657d00b43ef76606e208159273d.zip
gcc-e2a12aca42db7657d00b43ef76606e208159273d.tar.gz
gcc-e2a12aca42db7657d00b43ef76606e208159273d.tar.bz2
dbxout.c (dbxout_source_line): Make static, update prototype.
* dbxout.c (dbxout_source_line): Make static, update prototype. (dbx_debug_hooks, xcoff_debug_hooks): Add new hooks. (dbxout_init, dbxout_finish, dbxout_source_line, dbxout_begin_block, dbxout_end_block): Update for new prototypes. * dbxout.h (dbxout_source_line): Delete. * debug.c (debug_nothing_file, debug_nothing_file_int, debug_nothing_file_charstar_rtx): New. (do_nothing_debug_hooks): Update. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * debug.h (struct rtx_def): Declare. (gcc_debug_hooks): New hooks source_line, end_epilogue and end_function. (debug_nothing_void, debug_nothing_charstar_rtx, dwarf2out_end_epilogue): New. (debug_nothing_file_charstar, debug_nothing_file_int_int): Rename. * dwarf2out.c (dwarf2out_source_line): Make static, update prototype. (dwarf2_debug_hooks): Update. (dwarf2out_init, dwarf2out_finish, dwarf2out_source_line, dwarf2out_begin_block, dwarf2out_end_block): Update for new prototypes. * dwarf2out.h (dwarf2out_source_line): Remove. * dwarfout.c (dwarfout_end_epilogue, dwarfout_end_function): Make static, update prototype. (dwarfout_init, dwarfout_finish, dwarfout_source_line, dwarfout_begin_block, dwarfout_end_block): Update for new prototypes. (dwarf_debug_hooks): Update. * dwarfout.h (dwarfout_end_epilogue, dwarfout_source_line, dwarfout_end_function): Remove. * final.c (profile_function): Use debug hooks for ending functions and epilogues. (output_source_line, final_end_function): Update prototype, use debug hooks. (final_start_function, final_scan_insn): Update. * output.h (sdb_begin_function_line): Remove. (final_end_function): Update prototype. * sdbout.c (sdb_begin_function_line): Make static. (PUT_SDB_EPILOGUE_END): Move to sdbout_end_epilogue. (sdbout_source_line): New. (sdbout_end_epilogue, sdbout_end_function): Make static, update prototypes. (sdb_debug_hooks): Update. (sdbout_init, sdbout_source_line, sdbout_begin_block, sdbout_end_block): Update for new prototypes. * sdbout.h (sdbout_end_epilogue, sdbout_end_function): Remove. * toplev.c (compile_file, rest_of_compilation): Update. * tree.h (dwarf2out_end_epilogue): Move to debug.h. * xcoffout.c (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue, xcoffout_end_function): Update for prototype changes. * xcoffout.h (xcoffout_source_line, xcoffout_begin_block, xcoffout_end_block, xcoffout_end_epilogue): Update prototypes. From-SVN: r44017
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c97
1 files changed, 14 insertions, 83 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 99cc446..83b2297 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -252,7 +252,7 @@ static void profile_function PARAMS ((FILE *));
static void profile_after_prologue PARAMS ((FILE *));
static void add_bb PARAMS ((FILE *));
static int add_bb_string PARAMS ((const char *, int));
-static void output_source_line PARAMS ((FILE *, rtx));
+static void output_source_line PARAMS ((rtx));
static rtx walk_alter_subreg PARAMS ((rtx));
static void output_asm_name PARAMS ((void));
static void output_operand PARAMS ((rtx, int));
@@ -1606,7 +1606,7 @@ final_start_function (first, file, optimize)
/* But only output line number for other debug info types if -g2
or better. */
if (NOTE_LINE_NUMBER (first) != NOTE_INSN_DELETED)
- output_source_line (file, first);
+ output_source_line (first);
#ifdef LEAF_REG_REMAP
if (current_function_uses_only_leaf_regs)
@@ -1757,52 +1757,24 @@ profile_function (file)
even though not all of them are needed. */
void
-final_end_function (first, file, optimize)
- rtx first ATTRIBUTE_UNUSED;
- FILE *file ATTRIBUTE_UNUSED;
- int optimize ATTRIBUTE_UNUSED;
+final_end_function ()
{
app_disable ();
-#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG)
- sdbout_end_function (high_function_linenum);
-#endif
-
-#ifdef DWARF_DEBUGGING_INFO
- if (write_symbols == DWARF_DEBUG)
- dwarfout_end_function ();
-#endif
-
-#ifdef XCOFF_DEBUGGING_INFO
- if (write_symbols == XCOFF_DEBUG)
- xcoffout_end_function (file, high_function_linenum);
-#endif
+ (*debug_hooks->end_function) (high_function_linenum);
/* Finally, output the function epilogue:
code to restore the stack frame and return to the caller. */
- (*targetm.asm_out.function_epilogue) (file, get_frame_size ());
+ (*targetm.asm_out.function_epilogue) (asm_out_file, get_frame_size ());
-#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG)
- sdbout_end_epilogue ();
-#endif
+ /* And debug output. */
+ (*debug_hooks->end_epilogue) ();
-#ifdef DWARF_DEBUGGING_INFO
- if (write_symbols == DWARF_DEBUG)
- dwarfout_end_epilogue ();
-#endif
-
-#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
- if (dwarf2out_do_frame ())
+#if defined (DWARF2_UNWIND_INFO)
+ if (write_symbols != DWARF2_DEBUG && dwarf2out_do_frame ())
dwarf2out_end_epilogue ();
#endif
-#ifdef XCOFF_DEBUGGING_INFO
- if (write_symbols == XCOFF_DEBUG)
- xcoffout_end_epilogue (file);
-#endif
-
bb_func_label_num = -1; /* not in function, nuke label # */
}
@@ -2140,7 +2112,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
high_block_linenum = last_linenum;
/* Output debugging info about the symbol-block beginning. */
- (*debug_hooks->begin_block) (file, last_linenum, n);
+ (*debug_hooks->begin_block) (last_linenum, n);
/* Mark this block as output. */
TREE_ASM_WRITTEN (NOTE_BLOCK (insn)) = 1;
@@ -2162,7 +2134,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
if (block_depth < 0)
abort ();
- (*debug_hooks->end_block) (file, high_block_linenum, n);
+ (*debug_hooks->end_block) (high_block_linenum, n);
}
break;
@@ -2219,7 +2191,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
/* Output this line note if it is the first or the last line
note in a row. */
if (!note_after)
- output_source_line (file, insn);
+ output_source_line (insn);
}
break;
}
@@ -2934,8 +2906,7 @@ final_scan_insn (insn, file, optimize, prescan, nopeepholes)
based on the NOTE-insn INSN, assumed to be a line number. */
static void
-output_source_line (file, insn)
- FILE *file ATTRIBUTE_UNUSED;
+output_source_line (insn)
rtx insn;
{
register const char *filename = NOTE_SOURCE_FILE (insn);
@@ -2953,47 +2924,7 @@ output_source_line (file, insn)
high_block_linenum = MAX (last_linenum, high_block_linenum);
high_function_linenum = MAX (last_linenum, high_function_linenum);
- if (write_symbols != NO_DEBUG)
- {
-#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG
-#if 0 /* People like having line numbers even in wrong file! */
- /* COFF can't handle multiple source files--lose, lose. */
- && !strcmp (filename, main_input_filename)
-#endif
- /* COFF relative line numbers must be positive. */
- && last_linenum > sdb_begin_function_line)
- {
-#ifdef ASM_OUTPUT_SOURCE_LINE
- ASM_OUTPUT_SOURCE_LINE (file, last_linenum);
-#else
- fprintf (file, "\t.ln\t%d\n",
- ((sdb_begin_function_line > -1)
- ? last_linenum - sdb_begin_function_line : 1));
-#endif
- }
-#endif
-
-#if defined (DBX_DEBUGGING_INFO)
- if (write_symbols == DBX_DEBUG)
- dbxout_source_line (file, filename, NOTE_LINE_NUMBER (insn));
-#endif
-
-#if defined (XCOFF_DEBUGGING_INFO)
- if (write_symbols == XCOFF_DEBUG)
- xcoffout_source_line (file, filename, insn);
-#endif
-
-#ifdef DWARF_DEBUGGING_INFO
- if (write_symbols == DWARF_DEBUG)
- dwarfout_line (filename, NOTE_LINE_NUMBER (insn));
-#endif
-
-#ifdef DWARF2_DEBUGGING_INFO
- if (write_symbols == DWARF2_DEBUG)
- dwarf2out_line (filename, NOTE_LINE_NUMBER (insn));
-#endif
- }
+ (*debug_hooks->source_line) (filename, insn);
}
/* For each operand in INSN, simplify (subreg (reg)) so that it refers