diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-07-15 08:34:46 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-07-15 08:34:46 +0000 |
commit | e2a12aca42db7657d00b43ef76606e208159273d (patch) | |
tree | 3f39c7aa98569361a789583a5906c27e2596de19 | |
parent | be7b80f42726389bd25888ede4f13d276bb12ef0 (diff) | |
download | gcc-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
-rw-r--r-- | gcc/ChangeLog | 55 | ||||
-rw-r--r-- | gcc/dbxout.c | 54 | ||||
-rw-r--r-- | gcc/dbxout.h | 1 | ||||
-rw-r--r-- | gcc/debug.c | 29 | ||||
-rw-r--r-- | gcc/debug.h | 45 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 34 | ||||
-rw-r--r-- | gcc/dwarf2out.h | 1 | ||||
-rw-r--r-- | gcc/dwarfout.c | 45 | ||||
-rw-r--r-- | gcc/dwarfout.h | 5 | ||||
-rw-r--r-- | gcc/final.c | 97 | ||||
-rw-r--r-- | gcc/output.h | 9 | ||||
-rw-r--r-- | gcc/sdbout.c | 77 | ||||
-rw-r--r-- | gcc/sdbout.h | 3 | ||||
-rw-r--r-- | gcc/toplev.c | 6 | ||||
-rw-r--r-- | gcc/tree.h | 4 | ||||
-rw-r--r-- | gcc/xcoffout.c | 39 | ||||
-rw-r--r-- | gcc/xcoffout.h | 10 |
17 files changed, 271 insertions, 243 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b7e9e88..95e2f32 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,58 @@ +2001-07-15 Neil Booth <neil@daikokuya.demon.co.uk> + + * 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. + 2001-07-15 Richard Henderson <rth@redhat.com> * config/alpha/alpha.h (TARGET_ABI_OSF): New. diff --git a/gcc/dbxout.c b/gcc/dbxout.c index d88b8eb..3dd3f80 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -284,10 +284,11 @@ static int current_sym_nchars; #define CONTIN do { } while (0) #endif -static void dbxout_init PARAMS ((FILE *, const char *)); -static void dbxout_finish PARAMS ((FILE *, const char *)); +static void dbxout_init PARAMS ((const char *)); +static void dbxout_finish PARAMS ((const char *)); static void dbxout_start_source_file PARAMS ((unsigned, const char *)); static void dbxout_end_source_file PARAMS ((unsigned)); +static void dbxout_source_line PARAMS ((const char *, rtx)); #if defined(ASM_OUTPUT_SECTION_NAME) static void dbxout_function_end PARAMS ((void)); #endif @@ -314,8 +315,8 @@ static void dbxout_really_begin_function PARAMS ((tree)); /* The debug hooks structure. */ #if defined (DBX_DEBUGGING_INFO) -static void dbxout_begin_block PARAMS ((FILE *, unsigned, unsigned)); -static void dbxout_end_block PARAMS ((FILE *, unsigned, unsigned)); +static void dbxout_begin_block PARAMS ((unsigned, unsigned)); +static void dbxout_end_block PARAMS ((unsigned, unsigned)); struct gcc_debug_hooks dbx_debug_hooks = { @@ -326,7 +327,10 @@ struct gcc_debug_hooks dbx_debug_hooks = dbxout_start_source_file, dbxout_end_source_file, dbxout_begin_block, - dbxout_end_block + dbxout_end_block, + dbxout_source_line, + debug_nothing_void, /* end_epilogue */ + debug_nothing_int /* end function */ }; #endif /* DBX_DEBUGGING_INFO */ @@ -340,7 +344,10 @@ struct gcc_debug_hooks xcoff_debug_hooks = dbxout_start_source_file, dbxout_end_source_file, xcoffout_begin_block, - xcoffout_end_block + xcoffout_end_block, + xcoffout_source_line, + xcoffout_end_epilogue, + xcoffout_end_function }; #endif /* XCOFF_DEBUGGING_INFO */ @@ -371,14 +378,13 @@ dbxout_function_end () Initialize `typevec' and output the standard data types of C. */ static void -dbxout_init (asm_file, input_file_name) - FILE *asm_file; +dbxout_init (input_file_name) const char *input_file_name; { char ltext_label_name[100]; tree syms = getdecls (); - asmfile = asm_file; + asmfile = asm_out_file; typevec_len = 100; typevec = (struct typeinfo *) xcalloc (typevec_len, sizeof typevec[0]); @@ -556,18 +562,19 @@ dbxout_source_file (file, filename) /* Output a line number symbol entry into output stream FILE, for source file FILENAME and line number LINENO. */ -void -dbxout_source_line (file, filename, lineno) - FILE *file; +static void +dbxout_source_line (filename, note) const char *filename; - int lineno; + rtx note; { - dbxout_source_file (file, filename); + unsigned int lineno = NOTE_LINE_NUMBER (note); + + dbxout_source_file (asmfile, filename); #ifdef ASM_OUTPUT_SOURCE_LINE - ASM_OUTPUT_SOURCE_LINE (file, lineno); + ASM_OUTPUT_SOURCE_LINE (asmfile, lineno); #else - fprintf (file, "%s%d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno); + fprintf (asmfile, "%s%d,0,%d\n", ASM_STABD_OP, N_SLINE, lineno); #endif } @@ -576,23 +583,21 @@ dbxout_source_line (file, filename, lineno) /* Describe the beginning of an internal block within a function. */ static void -dbxout_begin_block (file, line, n) - FILE *file; +dbxout_begin_block (line, n) unsigned int line ATTRIBUTE_UNUSED; unsigned int n; { - ASM_OUTPUT_INTERNAL_LABEL (file, "LBB", n); + ASM_OUTPUT_INTERNAL_LABEL (asmfile, "LBB", n); } /* Describe the end line-number of an internal block within a function. */ static void -dbxout_end_block (file, line, n) - FILE *file; +dbxout_end_block (line, n) unsigned int line ATTRIBUTE_UNUSED; unsigned int n; { - ASM_OUTPUT_INTERNAL_LABEL (file, "LBE", n); + ASM_OUTPUT_INTERNAL_LABEL (asmfile, "LBE", n); } #endif /* DBX_DEBUGGING_INFO */ @@ -602,12 +607,11 @@ dbxout_end_block (file, line, n) to do nothing. */ static void -dbxout_finish (file, filename) - FILE *file ATTRIBUTE_UNUSED; +dbxout_finish (filename) const char *filename ATTRIBUTE_UNUSED; { #ifdef DBX_OUTPUT_MAIN_SOURCE_FILE_END - DBX_OUTPUT_MAIN_SOURCE_FILE_END (file, filename); + DBX_OUTPUT_MAIN_SOURCE_FILE_END (asmfile, filename); #endif /* DBX_OUTPUT_MAIN_SOURCE_FILE_END */ } diff --git a/gcc/dbxout.h b/gcc/dbxout.h index 3bdc795..e196b8f 100644 --- a/gcc/dbxout.h +++ b/gcc/dbxout.h @@ -26,5 +26,4 @@ extern void dbxout_parms PARAMS ((tree)); extern void dbxout_reg_parms PARAMS ((tree)); extern int dbxout_syms PARAMS ((tree)); extern void dbxout_function PARAMS ((tree)); -extern void dbxout_source_line PARAMS ((FILE *, const char *, int)); extern void dbxout_begin_function PARAMS ((tree)); diff --git a/gcc/debug.c b/gcc/debug.c index 5fb9a6f..5aa651c 100644 --- a/gcc/debug.c +++ b/gcc/debug.c @@ -22,22 +22,29 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* The do-nothing debug hooks. */ struct gcc_debug_hooks do_nothing_debug_hooks = { - debug_nothing_file_charstar, - debug_nothing_file_charstar, + debug_nothing_charstar, + debug_nothing_charstar, debug_nothing_int_charstar, debug_nothing_int_charstar, debug_nothing_int_charstar, debug_nothing_int, - debug_nothing_file_int_int, - debug_nothing_file_int_int + debug_nothing_int_int, + debug_nothing_int_int, + debug_nothing_charstar_rtx, + debug_nothing_void, + debug_nothing_int }; /* This file contains implementations of each debug hook that do nothing. */ void -debug_nothing_file_charstar (file, main_filename) - FILE *file ATTRIBUTE_UNUSED; +debug_nothing_void () +{ +} + +void +debug_nothing_charstar (main_filename) const char *main_filename ATTRIBUTE_UNUSED; { } @@ -56,9 +63,15 @@ debug_nothing_int (line) } void -debug_nothing_file_int_int (file, line, n) - FILE *file ATTRIBUTE_UNUSED; +debug_nothing_int_int (line, n) unsigned int line ATTRIBUTE_UNUSED; unsigned int n ATTRIBUTE_UNUSED; { } + +void +debug_nothing_charstar_rtx (filename, note) + const char *filename ATTRIBUTE_UNUSED; + struct rtx_def *note ATTRIBUTE_UNUSED; +{ +} diff --git a/gcc/debug.h b/gcc/debug.h index 755ac0a..c2e31a8 100644 --- a/gcc/debug.h +++ b/gcc/debug.h @@ -18,17 +18,19 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef GCC_DEBUG_H #define GCC_DEBUG_H +struct rtx_def; + /* This structure contains hooks for the debug information output functions, accessed through the global instance debug_hooks set in toplev.c according to command line options. */ struct gcc_debug_hooks { - /* Initialise debug output to FILE. MAIN_FILENAME is the name of - the main input file. */ - void (* init) PARAMS ((FILE * file, const char *main_filename)); + /* Initialise debug output. MAIN_FILENAME is the name of the main + input file. */ + void (* init) PARAMS ((const char *main_filename)); - /* Output debug symbols to FILE. */ - void (* finish) PARAMS ((FILE * file, const char *main_filename)); + /* Output debug symbols. */ + void (* finish) PARAMS ((const char *main_filename)); /* Macro defined on line LINE with name and expansion TEXT. */ void (* define) PARAMS ((unsigned int line, const char *text)); @@ -45,24 +47,38 @@ struct gcc_debug_hooks void (* end_source_file) PARAMS ((unsigned int line)); /* Record the beginning of block N, counting from 1 and not - including the function-scope block, at LINE. Output to FILE. */ - void (* begin_block) PARAMS ((FILE *, unsigned int line, unsigned int n)); + including the function-scope block, at LINE. */ + void (* begin_block) PARAMS ((unsigned int line, unsigned int n)); /* Record the end of a block. Arguments as for begin_block. */ - void (* end_block) PARAMS ((FILE *, unsigned int line, unsigned int n)); + void (* end_block) PARAMS ((unsigned int line, unsigned int n)); + + /* Record a line based on NOTE. Obtain the line number with + NOTE_LINE_NUMBER (note). */ + void (* source_line) PARAMS ((const char *filename, struct rtx_def *note)); + + /* Record end of epilogue code. */ + void (* end_epilogue) PARAMS ((void)); + + /* Record end of function. LINE is highest line number in function. */ + void (* end_function) PARAMS ((unsigned int line)); }; extern struct gcc_debug_hooks *debug_hooks; /* The do-nothing hooks. */ -extern void debug_nothing_file_charstar - PARAMS ((FILE *, const char *)); +extern void debug_nothing_void + PARAMS ((void)); +extern void debug_nothing_charstar + PARAMS ((const char *)); extern void debug_nothing_int_charstar PARAMS ((unsigned int, const char *)); extern void debug_nothing_int PARAMS ((unsigned int)); -extern void debug_nothing_file_int_int - PARAMS ((FILE *, unsigned int, unsigned int)); +extern void debug_nothing_int_int + PARAMS ((unsigned int, unsigned int)); +extern void debug_nothing_charstar_rtx + PARAMS ((const char *, struct rtx_def *)); /* Hooks for various debug formats. */ extern struct gcc_debug_hooks do_nothing_debug_hooks; @@ -72,4 +88,9 @@ extern struct gcc_debug_hooks xcoff_debug_hooks; extern struct gcc_debug_hooks dwarf_debug_hooks; extern struct gcc_debug_hooks dwarf2_debug_hooks; +/* Dwarf2 frame information. */ + +extern void dwarf2out_end_epilogue + PARAMS ((void)); + #endif /* !GCC_DEBUG_H */ diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c0359d3..207bda7 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -3001,14 +3001,15 @@ get_cfa_from_loc_descr (cfa, loc) /* And now, the support for symbolic debugging information. */ #ifdef DWARF2_DEBUGGING_INFO -static void dwarf2out_init PARAMS ((FILE *, const char *)); -static void dwarf2out_finish PARAMS ((FILE *, const char *)); +static void dwarf2out_init PARAMS ((const char *)); +static void dwarf2out_finish PARAMS ((const char *)); static void dwarf2out_define PARAMS ((unsigned int, const char *)); static void dwarf2out_undef PARAMS ((unsigned int, const char *)); static void dwarf2out_start_source_file PARAMS ((unsigned, const char *)); static void dwarf2out_end_source_file PARAMS ((unsigned)); -static void dwarf2out_begin_block PARAMS ((FILE *, unsigned, unsigned)); -static void dwarf2out_end_block PARAMS ((FILE *, unsigned, unsigned)); +static void dwarf2out_begin_block PARAMS ((unsigned, unsigned)); +static void dwarf2out_end_block PARAMS ((unsigned, unsigned)); +static void dwarf2out_source_line PARAMS ((const char *, rtx)); /* The debug hooks structure. */ @@ -3021,7 +3022,10 @@ struct gcc_debug_hooks dwarf2_debug_hooks = dwarf2out_start_source_file, dwarf2out_end_source_file, dwarf2out_begin_block, - dwarf2out_end_block + dwarf2out_end_block, + dwarf2out_source_line, + dwarf2out_end_epilogue, + debug_nothing_int /* end_function */ }; /* NOTE: In the comments in this file, many references are made to @@ -11108,8 +11112,7 @@ dwarf2out_decl (decl) a lexical block. */ static void -dwarf2out_begin_block (file, line, blocknum) - FILE *file ATTRIBUTE_UNUSED; +dwarf2out_begin_block (line, blocknum) unsigned int line ATTRIBUTE_UNUSED; unsigned int blocknum; { @@ -11121,8 +11124,7 @@ dwarf2out_begin_block (file, line, blocknum) lexical block. */ static void -dwarf2out_end_block (file, line, blocknum) - FILE *file ATTRIBUTE_UNUSED; +dwarf2out_end_block (line, blocknum) unsigned int line ATTRIBUTE_UNUSED; unsigned int blocknum; { @@ -11221,11 +11223,13 @@ init_file_table () and record information relating to this source line, in 'line_info_table' for later output of the .debug_line section. */ -void -dwarf2out_line (filename, line) +static void +dwarf2out_source_line (filename, note) register const char *filename; - register unsigned line; + rtx note; { + unsigned int line = NOTE_LINE_NUMBER (note); + if (debug_info_level >= DINFO_LEVEL_NORMAL) { function_section (current_function_decl); @@ -11385,8 +11389,7 @@ dwarf2out_undef (lineno, buffer) /* Set up for Dwarf output at the start of compilation. */ static void -dwarf2out_init (asm_out_file, main_input_filename) - register FILE *asm_out_file; +dwarf2out_init (main_input_filename) register const char *main_input_filename; { init_file_table (); @@ -11475,8 +11478,7 @@ dwarf2out_init (asm_out_file, main_input_filename) and generate the DWARF-2 debugging info. */ static void -dwarf2out_finish (asm_out_file, input_filename) - register FILE *asm_out_file; +dwarf2out_finish (input_filename) register const char *input_filename ATTRIBUTE_UNUSED; { limbo_die_node *node, *next_node; diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 4250dfd..83056e5 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -20,7 +20,6 @@ Boston, MA 02111-1307, USA. */ extern int dwarf2out_ignore_block PARAMS ((tree)); extern void dwarf2out_decl PARAMS ((tree)); -extern void dwarf2out_line PARAMS ((const char *, unsigned)); extern void dwarf2out_frame_init PARAMS ((void)); extern void dwarf2out_frame_debug PARAMS ((rtx)); extern void dwarf2out_frame_finish PARAMS ((void)); diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index 3263f10..f6e984e 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -787,16 +787,19 @@ static int in_class; /* Forward declarations for functions defined in this file. */ -static void dwarfout_init PARAMS ((FILE *, const char *)); -static void dwarfout_finish PARAMS ((FILE *, const char *)); +static void dwarfout_init PARAMS ((const char *)); +static void dwarfout_finish PARAMS ((const char *)); static void dwarfout_define PARAMS ((unsigned int, const char *)); static void dwarfout_undef PARAMS ((unsigned int, const char *)); static void dwarfout_start_source_file PARAMS ((unsigned, const char *)); static void dwarfout_start_source_file_check PARAMS ((unsigned, const char *)); static void dwarfout_end_source_file PARAMS ((unsigned)); static void dwarfout_end_source_file_check PARAMS ((unsigned)); -static void dwarfout_begin_block PARAMS ((FILE *, unsigned, unsigned)); -static void dwarfout_end_block PARAMS ((FILE *, unsigned, unsigned)); +static void dwarfout_begin_block PARAMS ((unsigned, unsigned)); +static void dwarfout_end_block PARAMS ((unsigned, unsigned)); +static void dwarfout_end_epilogue PARAMS ((void)); +static void dwarfout_source_line PARAMS (( const char *, rtx)); +static void dwarfout_end_function PARAMS ((unsigned int)); static const char *dwarf_tag_name PARAMS ((unsigned)); static const char *dwarf_attr_name PARAMS ((unsigned)); static const char *dwarf_stack_op_name PARAMS ((unsigned)); @@ -1379,7 +1382,10 @@ struct gcc_debug_hooks dwarf_debug_hooks = dwarfout_start_source_file_check, dwarfout_end_source_file_check, dwarfout_begin_block, - dwarfout_end_block + dwarfout_end_block, + dwarfout_source_line, + dwarfout_end_epilogue, + dwarfout_end_function }; /************************ general utility functions **************************/ @@ -5838,8 +5844,7 @@ dwarfout_file_scope_decl (decl, set_finalizing) for a lexical block. */ static void -dwarfout_begin_block (file, line, blocknum) - FILE *file ATTRIBUTE_UNUSED; +dwarfout_begin_block (line, blocknum) unsigned int line ATTRIBUTE_UNUSED; unsigned int blocknum; { @@ -5854,8 +5859,7 @@ dwarfout_begin_block (file, line, blocknum) for a lexical block. */ static void -dwarfout_end_block (file, line, blocknum) - FILE *file ATTRIBUTE_UNUSED; +dwarfout_end_block (line, blocknum) unsigned int line ATTRIBUTE_UNUSED; unsigned int blocknum; { @@ -5885,8 +5889,9 @@ dwarfout_begin_function () /* Output a marker (i.e. a label) for the point in the generated code where the real body of the function ends (just before the epilogue code). */ -void -dwarfout_end_function () +static void +dwarfout_end_function (line) + unsigned int line ATTRIBUTE_UNUSED; { char label[MAX_ARTIFICIAL_LABEL_BYTES]; @@ -5901,7 +5906,7 @@ dwarfout_end_function () for a function definition. This gets called *after* the epilogue code has been generated. */ -void +static void dwarfout_end_epilogue () { char label[MAX_ARTIFICIAL_LABEL_BYTES]; @@ -6053,11 +6058,13 @@ generate_srcinfo_entry (line_entry_num, files_entry_num) ASM_OUTPUT_POP_SECTION (asm_out_file); } -void -dwarfout_line (filename, line) - register const char *filename; - register unsigned line; +static void +dwarfout_source_line (filename, note) + const char *filename; + rtx note; { + unsigned int line = NOTE_LINE_NUMBER (note); + if (debug_info_level >= DINFO_LEVEL_NORMAL /* We can't emit line number info for functions in separate sections, because the assembler can't subtract labels in different sections. */ @@ -6215,8 +6222,7 @@ dwarfout_undef (lineno, buffer) /* Set up for Dwarf output at the start of compilation. */ static void -dwarfout_init (asm_out_file, main_input_filename) - register FILE *asm_out_file; +dwarfout_init (main_input_filename) register const char *main_input_filename; { /* Remember the name of the primary input file. */ @@ -6405,8 +6411,7 @@ dwarfout_init (asm_out_file, main_input_filename) /* Output stuff that dwarf requires at the end of every file. */ static void -dwarfout_finish (asm_out_file, main_input_filename) - register FILE *asm_out_file; +dwarfout_finish (main_input_filename) register const char *main_input_filename ATTRIBUTE_UNUSED; { char label[MAX_ARTIFICIAL_LABEL_BYTES]; diff --git a/gcc/dwarfout.h b/gcc/dwarfout.h index 9e4ca62..bd4eaf3 100644 --- a/gcc/dwarfout.h +++ b/gcc/dwarfout.h @@ -21,8 +21,3 @@ Boston, MA 02111-1307, USA. */ extern void dwarfout_file_scope_decl PARAMS ((tree , int)); extern void dwarfout_begin_function PARAMS ((void)); -extern void dwarfout_end_function PARAMS ((void)); -extern void dwarfout_begin_epilogue PARAMS ((void)); -extern void dwarfout_end_epilogue PARAMS ((void)); - -extern void dwarfout_line PARAMS ((const char *, unsigned)); 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 diff --git a/gcc/output.h b/gcc/output.h index 071d240..93b94c4 100644 --- a/gcc/output.h +++ b/gcc/output.h @@ -62,7 +62,7 @@ extern void final_start_function PARAMS ((rtx, FILE *, int)); /* Output assembler code for the end of a function. For clarity, args are same as those of `final_start_function' even though not all of them are needed. */ -extern void final_end_function PARAMS ((rtx, FILE *, int)); +extern void final_end_function PARAMS ((void)); /* Output assembler code for some insns: all or part of a function. */ extern void final PARAMS ((rtx, FILE *, int, int)); @@ -374,13 +374,6 @@ extern void output_constant PARAMS ((tree, int)); extern rtx final_sequence; #endif -/* The line number of the beginning of the current function. - sdbout.c needs this so that it can output relative linenumbers. */ - -#ifdef SDB_DEBUGGING_INFO /* Avoid undef sym in certain broken linkers. */ -extern int sdb_begin_function_line; -#endif - /* File in which assembler code is being written. */ #ifdef BUFSIZ diff --git a/gcc/sdbout.c b/gcc/sdbout.c index aecdcf7..1faffbe 100644 --- a/gcc/sdbout.c +++ b/gcc/sdbout.c @@ -80,7 +80,7 @@ AT&T C compiler. From the example below I would conclude the following: /* Line number of beginning of current function, minus one. Negative means not in a function or not using sdb. */ -int sdb_begin_function_line = -1; +static int sdb_begin_function_line = -1; /* Counter to generate unique "names" for nameless struct members. */ @@ -92,11 +92,14 @@ extern tree current_function_decl; #include "sdbout.h" -static void sdbout_init PARAMS ((FILE *, const char *)); +static void sdbout_init PARAMS ((const char *)); static void sdbout_start_source_file PARAMS ((unsigned, const char *)); static void sdbout_end_source_file PARAMS ((unsigned)); -static void sdbout_begin_block PARAMS ((FILE *, unsigned, unsigned)); -static void sdbout_end_block PARAMS ((FILE *, unsigned, unsigned)); +static void sdbout_begin_block PARAMS ((unsigned, unsigned)); +static void sdbout_end_block PARAMS ((unsigned, unsigned)); +static void sdbout_source_line PARAMS ((const char *, rtx)); +static void sdbout_end_epilogue PARAMS ((void)); +static void sdbout_end_function PARAMS ((unsigned int)); static char *gen_fake_label PARAMS ((void)); static int plain_type PARAMS ((tree)); static int template_name_p PARAMS ((tree)); @@ -225,15 +228,6 @@ do { fprintf (asm_out_file, "\t.tag\t"); \ SDB_DELIM, SDB_DELIM, SDB_DELIM, (LINE), SDB_DELIM) #endif -#ifndef PUT_SDB_EPILOGUE_END -#define PUT_SDB_EPILOGUE_END(NAME) \ -do { fprintf (asm_out_file, "\t.def\t"); \ - assemble_name (asm_out_file, NAME); \ - fprintf (asm_out_file, \ - "%s\t.val\t.%s\t.scl\t-1%s\t.endef\n", \ - SDB_DELIM, SDB_DELIM, SDB_DELIM); } while (0) -#endif - #ifndef SDB_GENERATE_FAKE #define SDB_GENERATE_FAKE(BUFFER, NUMBER) \ sprintf ((BUFFER), ".%dfake", (NUMBER)); @@ -297,13 +291,16 @@ static struct sdb_file *current_file; struct gcc_debug_hooks sdb_debug_hooks = { sdbout_init, - debug_nothing_file_charstar, + debug_nothing_charstar, debug_nothing_int_charstar, debug_nothing_int_charstar, sdbout_start_source_file, sdbout_end_source_file, sdbout_begin_block, - sdbout_end_block + sdbout_end_block, + sdbout_source_line, + sdbout_end_epilogue, + sdbout_end_function }; #if 0 @@ -1471,8 +1468,7 @@ sdbout_reg_parms (parms) if the count starts at 0 for the outermost one. */ static void -sdbout_begin_block (file, line, n) - FILE *file ATTRIBUTE_UNUSED; +sdbout_begin_block (line, n) unsigned int line; unsigned int n; { @@ -1508,9 +1504,8 @@ sdbout_begin_block (file, line, n) /* Describe the end line-number of an internal block within a function. */ -void -sdbout_end_block (file, line, n) - FILE *file ATTRIBUTE_UNUSED; +static void +sdbout_end_block (line, n) unsigned int line; unsigned int n ATTRIBUTE_UNUSED; { @@ -1525,6 +1520,26 @@ sdbout_end_block (file, line, n) PUT_SDB_BLOCK_END (line - sdb_begin_function_line); } +static void +sdbout_source_line (filename, note) + const char *filename ATTRIBUTE_UNUSED; + rtx note; +{ + unsigned int line = NOTE_LINE_NUMBER (note); + + /* COFF relative line numbers must be positive. */ + if (line > sdb_begin_function_line) + { +#ifdef ASM_OUTPUT_SOURCE_LINE + ASM_OUTPUT_SOURCE_LINE (asm_out_file, line); +#else + fprintf (asm_out_file, "\t.ln\t%d\n", + ((sdb_begin_function_line > -1) + ? line - sdb_begin_function_line : 1)); +#endif + } +} + /* Output sdb info for the current function name. Called from assemble_start_function. */ @@ -1553,9 +1568,9 @@ sdbout_begin_function (line) /* Called at end of function (before epilogue). Describe end of outermost block. */ -void +static void sdbout_end_function (line) - int line; + unsigned int line; { #ifdef SDB_ALLOW_FORWARD_REFERENCES sdbout_dequeue_anonymous_types (); @@ -1571,11 +1586,20 @@ sdbout_end_function (line) /* Output sdb info for the absolute end of a function. Called after the epilogue is output. */ -void +static void sdbout_end_epilogue () { - PUT_SDB_EPILOGUE_END - (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl))); + const char *name + = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)); + +#ifdef PUT_SDB_EPILOGUE_END + PUT_SDB_EPILOGUE_END (name); +#else + fprintf (asm_out_file, "\t.def\t"); + assemble_name (asm_out_file, name); + fprintf (asm_out_file, "%s\t.val\t.%s\t.scl\t-1%s\t.endef\n", + SDB_DELIM, SDB_DELIM, SDB_DELIM); +#endif } /* Output sdb info for the given label. Called only if LABEL_NAME (insn) @@ -1628,8 +1652,7 @@ sdbout_end_source_file (line) /* Set up for SDB output at the start of compilation. */ static void -sdbout_init (asm_file, input_file_name) - FILE *asm_file ATTRIBUTE_UNUSED; +sdbout_init (input_file_name) const char *input_file_name ATTRIBUTE_UNUSED; { #ifdef MIPS_DEBUGGING_INFO diff --git a/gcc/sdbout.h b/gcc/sdbout.h index 0118cd1..5a5ca8f 100644 --- a/gcc/sdbout.h +++ b/gcc/sdbout.h @@ -19,14 +19,11 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern void sdbout_begin_function PARAMS ((int)); -extern void sdbout_end_function PARAMS ((int)); extern void sdbout_label PARAMS ((rtx)); extern void sdbout_symbol PARAMS ((tree, int)); extern void sdbout_toplevel_data PARAMS ((tree)); extern void sdbout_types PARAMS ((tree)); -extern void sdbout_end_epilogue PARAMS ((void)); - extern void sdbout_mark_begin_function PARAMS ((void)); diff --git a/gcc/toplev.c b/gcc/toplev.c index 1aa8806..e63fc47 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2343,7 +2343,7 @@ compile_file (name) dwarf2out_frame_init (); #endif - (*debug_hooks->init) (asm_out_file, main_input_filename); + (*debug_hooks->init) (main_input_filename); timevar_pop (TV_SYMOUT); /* Initialize yet another pass. */ @@ -2422,7 +2422,7 @@ compile_file (name) dwarf2out_frame_finish (); #endif - (*debug_hooks->finish) (asm_out_file, main_input_filename); + (*debug_hooks->finish) (main_input_filename); timevar_pop (TV_SYMOUT); /* Output some stuff at end of file if nec. */ @@ -3752,7 +3752,7 @@ rest_of_compilation (decl) assemble_start_function (decl, fnname); final_start_function (insns, asm_out_file, optimize); final (insns, asm_out_file, optimize, 0); - final_end_function (insns, asm_out_file, optimize); + final_end_function (); #ifdef IA64_UNWIND_INFO /* ??? The IA-64 ".handlerdata" directive must be issued before @@ -2924,10 +2924,6 @@ extern void dwarf2out_return_reg PARAMS ((const char *, unsigned)); extern void dwarf2out_begin_prologue PARAMS ((void)); -/* Output a marker (i.e. a label) for the absolute end of the generated - code for a function definition. */ - -extern void dwarf2out_end_epilogue PARAMS ((void)); /* Redefine abort to report an internal error w/o coredump, and reporting the location of the error in the source file. This logic diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c index 326a692..e8dd43f 100644 --- a/gcc/xcoffout.c +++ b/gcc/xcoffout.c @@ -308,14 +308,13 @@ xcoffout_source_file (file, filename, inline_p) for source file FILENAME and line number NOTE. */ void -xcoffout_source_line (file, filename, note) - FILE *file; +xcoffout_source_line (filename, note) const char *filename; rtx note; { - xcoffout_source_file (file, filename, RTX_INTEGRATED_P (note)); + xcoffout_source_file (asm_out_file, filename, RTX_INTEGRATED_P (note)); - ASM_OUTPUT_SOURCE_LINE (file, NOTE_LINE_NUMBER (note)); + ASM_OUTPUT_SOURCE_LINE (asm_out_file, NOTE_LINE_NUMBER (note)); } /* Output the symbols defined in block number DO_BLOCK. @@ -368,17 +367,16 @@ xcoffout_block (block, depth, args) if the count starts at 0 for the outermost one. */ void -xcoffout_begin_block (file, line, n) - FILE *file; - int line; - int n; +xcoffout_begin_block (line, n) + unsigned int line; + unsigned int n; { tree decl = current_function_decl; /* The IBM AIX compiler does not emit a .bb for the function level scope, so we avoid it here also. */ if (n != 1) - ASM_OUTPUT_LBB (file, line, n); + ASM_OUTPUT_LBB (asm_out_file, line, n); do_block = n; xcoffout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl)); @@ -387,13 +385,12 @@ xcoffout_begin_block (file, line, n) /* Describe the end line-number of an internal block within a function. */ void -xcoffout_end_block (file, line, n) - FILE *file; - int line; - int n; +xcoffout_end_block (line, n) + unsigned int line; + unsigned int n; { if (n != 1) - ASM_OUTPUT_LBE (file, line, n); + ASM_OUTPUT_LBE (asm_out_file, line, n); } /* Called at beginning of function (before prologue). @@ -462,19 +459,17 @@ xcoffout_begin_function (file, last_linenum) Describe end of outermost block. */ void -xcoffout_end_function (file, last_linenum) - FILE *file; - int last_linenum; +xcoffout_end_function (last_linenum) + unsigned int last_linenum; { - ASM_OUTPUT_LFE (file, last_linenum); + ASM_OUTPUT_LFE (asm_out_file, last_linenum); } /* Output xcoff info for the absolute end of a function. Called after the epilogue is output. */ void -xcoffout_end_epilogue (file) - FILE *file; +xcoffout_end_epilogue () { /* We need to pass the correct function size to .function, otherwise, the xas assembler can't figure out the correct size for the function @@ -484,7 +479,7 @@ xcoffout_end_epilogue (file) const char *fname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); if (*fname == '*') ++fname; - fprintf (file, "FE.."); - ASM_OUTPUT_LABEL (file, fname); + fprintf (asm_out_file, "FE.."); + ASM_OUTPUT_LABEL (asm_out_file, fname); } #endif /* XCOFF_DEBUGGING_INFO */ diff --git a/gcc/xcoffout.h b/gcc/xcoffout.h index d44fad7..a7cfe63 100644 --- a/gcc/xcoffout.h +++ b/gcc/xcoffout.h @@ -200,10 +200,10 @@ extern const char *xcoff_lastfile; extern int stab_to_sclass PARAMS ((int)); #ifdef BUFSIZ extern void xcoffout_begin_function PARAMS ((FILE *, int)); -extern void xcoffout_begin_block PARAMS ((FILE *, int, int)); -extern void xcoffout_end_epilogue PARAMS ((FILE *)); -extern void xcoffout_end_function PARAMS ((FILE *, int)); -extern void xcoffout_end_block PARAMS ((FILE *, int, int)); +extern void xcoffout_begin_block PARAMS ((unsigned, unsigned)); +extern void xcoffout_end_epilogue PARAMS ((void)); +extern void xcoffout_end_function PARAMS ((unsigned int)); +extern void xcoffout_end_block PARAMS ((unsigned, unsigned)); #endif /* BUFSIZ */ #ifdef TREE_CODE @@ -215,6 +215,6 @@ extern void xcoffout_declare_function PARAMS ((FILE *, tree, const char *)); #ifdef RTX_CODE #ifdef BUFSIZ -extern void xcoffout_source_line PARAMS ((FILE *, const char *, rtx)); +extern void xcoffout_source_line PARAMS ((const char *, rtx)); #endif /* BUFSIZ */ #endif /* RTX_CODE */ |