* Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h.
(final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h.
(toplev.o): Don't depend on xcoffout.h.
* c-decl.c: Include debug.h
(duplicate_decls): Use debug hook.
* dbxout.c (dbxout_source_file, dbxout_args): Make static.
(dbx_debug_hooks, xcoff_debug_hooks): Update.
(dbxout_types): Remove.
* dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove.
* debug.c (do_nothing_debug_hooks): Update.
(debug_true_tree, debug_nothing_rtx): New.
* debug.h (struct rtx_def): New.
(struct gcc_debug_hooks): New hooks ignore_block,
outlining_inline_function and label.
(debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init,
dwarf2out_frame_finish): New.
* dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function):
Make static, update prototype.
(dwarf2_debug_hooks): Update.
* dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function,
dwarf2out_frame_init, dwarf2out_frame_finish): Remove.
* dwarfout.c (dwarf_debug_hooks): Update.
* emit-rtl.c: Include debug.h.
(remove_unnecessary_notes): Use debug hook.
* final.c: Don't include dbxout.h, xcoffout.h or sdbout.h.
(final_scan_insn): Use debug hook.
* integrate.c (output_inline_function): Use debug hook.
* sdbout.c (sdbout_toplevel_data, sdbout_label): Make static.
(sdb_debug_hooks): Update.
* sdbout.h (sdbout_label, sdbout_toplevel_data): Remove.
* toplev.c: Don't include xcoffout.h.
(note_outlining_of_inline_function, debug_ignore_block): Remove.
* toplev.h (note_outlining_of_inline_function, debug_ignore_block):
Remove.
* tree.h (dwarf2out_do_frame): Remove.
From-SVN: r44163
+2001-07-19 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * Makefile.in (emit-rtl.o, c-decl.o): Depend on debug.h.
+ (final.o): Don't depend on xcoffout.h, dbxout.h or sdbout.h.
+ (toplev.o): Don't depend on xcoffout.h.
+ * c-decl.c: Include debug.h
+ (duplicate_decls): Use debug hook.
+ * dbxout.c (dbxout_source_file, dbxout_args): Make static.
+ (dbx_debug_hooks, xcoff_debug_hooks): Update.
+ (dbxout_types): Remove.
+ * dbxout.h (dbxout_source_file, dbxout_types, dbxout_args): Remove.
+ * debug.c (do_nothing_debug_hooks): Update.
+ (debug_true_tree, debug_nothing_rtx): New.
+ * debug.h (struct rtx_def): New.
+ (struct gcc_debug_hooks): New hooks ignore_block,
+ outlining_inline_function and label.
+ (debug_true_tree, debug_nothing_rtx, dwarf2out_frame_init,
+ dwarf2out_frame_finish): New.
+ * dwarf2out.c (dwarf2out_ignore_block, dwarf2out_abstract_function):
+ Make static, update prototype.
+ (dwarf2_debug_hooks): Update.
+ * dwarf2out.h (dwarf2out_ignore_block, dwarf2out_abstract_function,
+ dwarf2out_frame_init, dwarf2out_frame_finish): Remove.
+ * dwarfout.c (dwarf_debug_hooks): Update.
+ * emit-rtl.c: Include debug.h.
+ (remove_unnecessary_notes): Use debug hook.
+ * final.c: Don't include dbxout.h, xcoffout.h or sdbout.h.
+ (final_scan_insn): Use debug hook.
+ * integrate.c (output_inline_function): Use debug hook.
+ * sdbout.c (sdbout_toplevel_data, sdbout_label): Make static.
+ (sdb_debug_hooks): Update.
+ * sdbout.h (sdbout_label, sdbout_toplevel_data): Remove.
+ * toplev.c: Don't include xcoffout.h.
+ (note_outlining_of_inline_function, debug_ignore_block): Remove.
+ * toplev.h (note_outlining_of_inline_function, debug_ignore_block):
+ Remove.
+ * tree.h (dwarf2out_do_frame): Remove.
+
2001-07-19 Catherine Moore <clm@cygnus.com>
* config/v850/v850.h (ASM_OUTPUT_LABELREF): Restore.
c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(C_TREE_H) \
$(GGC_H) $(TARGET_H) c-lex.h flags.h function.h output.h $(EXPR_H) \
- toplev.h intl.h $(TM_P_H)
+ debug.h toplev.h intl.h $(TM_P_H)
c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
$(TARGET_H) flags.h intl.h output.h $(EXPR_H) $(RTL_H) toplev.h $(TM_P_H)
c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(C_TREE_H) \
$(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) $(TM_P_H) flags.h \
$(GGC_H) input.h $(INSN_ATTR_H) insn-config.h toplev.h intl.h
toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) function.h \
- flags.h input.h $(INSN_ATTR_H) xcoffout.h output.h diagnostic.h \
+ flags.h input.h $(INSN_ATTR_H) output.h diagnostic.h \
debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.h \
dwarf2out.h sdbout.h dbxout.h $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) \
graph.h $(LOOP_H) except.h $(REGS_H) $(TIMEVAR_H) $(lang_options_files) \
emit-rtl.o : emit-rtl.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
function.h $(REGS_H) insn-config.h $(RECOG_H) real.h $(GGC_H) \
$(EXPR_H) $(srcdir)/../include/obstack.h hard-reg-set.h bitmap.h toplev.h \
- $(HASHTAB_H) $(TM_P_H)
+ $(HASHTAB_H) $(TM_P_H) debug.h
real.o : real.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) toplev.h $(TM_P_H)
integrate.o : integrate.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \
debug.h $(INTEGRATE_H) insn-config.h $(EXPR_H) real.h $(REGS_H) \
final.o : final.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h intl.h \
$(REGS_H) $(RECOG_H) conditions.h insn-config.h $(INSN_ATTR_H) function.h \
real.h output.h hard-reg-set.h except.h debug.h \
- xcoffout.h toplev.h reload.h dwarf2out.h sdbout.h \
- dbxout.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H)
+ toplev.h reload.h dwarf2out.h $(BASIC_BLOCK_H) $(TM_P_H) $(TARGET_H)
recog.o : recog.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) function.h $(BASIC_BLOCK_H) \
$(REGS_H) $(RECOG_H) $(EXPR_H) hard-reg-set.h flags.h insn-config.h \
$(INSN_ATTR_H) real.h toplev.h output.h reload.h $(TM_P_H)
#include "tm_p.h"
#include "cpplib.h"
#include "target.h"
+#include "debug.h"
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
been written out yet. */
if (new_is_definition && DECL_INITIAL (olddecl) && TREE_USED (olddecl))
{
- note_outlining_of_inline_function (olddecl);
+ (*debug_hooks->outlining_inline_function) (olddecl);
/* The new defn must not be inline. */
DECL_INLINE (newdecl) = 0;
static void dbxout_start_source_file PARAMS ((unsigned, const char *));
static void dbxout_end_source_file PARAMS ((unsigned));
static void dbxout_source_line PARAMS ((unsigned int, const char *));
+static void dbxout_source_file PARAMS ((FILE *, const char *));
#if defined(ASM_OUTPUT_SECTION_NAME)
static void dbxout_function_end PARAMS ((void));
#endif
#if DBX_CONTIN_LENGTH > 0
static void dbxout_continue PARAMS ((void));
#endif
+static void dbxout_args PARAMS ((tree));
static void dbxout_type_fields PARAMS ((tree));
static void dbxout_type_method_1 PARAMS ((tree, const char *));
static void dbxout_type_methods PARAMS ((tree));
dbxout_end_source_file,
dbxout_begin_block,
dbxout_end_block,
+ debug_true_tree, /* ignore_block */
dbxout_source_line, /* source_line */
dbxout_source_line, /* begin_prologue: just output line info */
debug_nothing_int, /* end_prologue */
debug_nothing_int, /* end_function */
dbxout_function_decl,
debug_nothing_tree, /* global_decl */
- debug_nothing_tree /* deferred_inline_function */
+ debug_nothing_tree, /* deferred_inline_function */
+ debug_nothing_tree, /* outlining_inline_function */
+ debug_nothing_rtx /* label */
};
#endif /* DBX_DEBUGGING_INFO */
dbxout_end_source_file,
xcoffout_begin_block,
xcoffout_end_block,
+ debug_true_tree, /* ignore_block */
xcoffout_source_line,
xcoffout_begin_prologue, /* begin_prologue */
debug_nothing_int, /* end_prologue */
xcoffout_end_function,
debug_nothing_tree, /* function_decl */
debug_nothing_tree, /* global_decl */
- debug_nothing_tree /* deferred_inline_function */
+ debug_nothing_tree, /* deferred_inline_function */
+ debug_nothing_tree, /* outlining_inline_function */
+ debug_nothing_rtx /* label */
};
#endif /* XCOFF_DEBUGGING_INFO */
\f
/* Output debugging info to FILE to switch to sourcefile FILENAME. */
-void
+static void
dbxout_source_file (file, filename)
FILE *file;
const char *filename;
/* Given a chain of ..._TYPE nodes (as come in a parameter list),
output definitions of those names, in raw form */
-void
+static void
dbxout_args (args)
tree args;
{
}
}
\f
-/* Given a chain of ..._TYPE nodes,
- find those which have typedef names and output those names.
- This is to ensure those types get output. */
-
-void
-dbxout_types (types)
- register tree types;
-{
- while (types)
- {
- if (TYPE_NAME (types)
- && TREE_CODE (TYPE_NAME (types)) == TYPE_DECL
- && ! TREE_ASM_WRITTEN (TYPE_NAME (types)))
- dbxout_symbol (TYPE_NAME (types), 1);
- types = TREE_CHAIN (types);
- }
-}
-\f
/* Output everything about a symbol block (a BLOCK node
that represents a scope level),
including recursive output of contained blocks.
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-extern void dbxout_source_file PARAMS ((FILE *, const char *));
-extern void dbxout_types PARAMS ((tree));
-extern void dbxout_args PARAMS ((tree));
extern int dbxout_symbol PARAMS ((tree, int));
extern void dbxout_parms PARAMS ((tree));
extern void dbxout_reg_parms PARAMS ((tree));
debug_nothing_int_charstar,
debug_nothing_int_charstar,
debug_nothing_int,
- debug_nothing_int_int,
- debug_nothing_int_int,
+ debug_nothing_int_int, /* begin_block */
+ debug_nothing_int_int, /* end_block */
+ debug_true_tree, /* ignore_block */
debug_nothing_int_charstar, /* source_line */
debug_nothing_int_charstar, /* begin_prologue */
debug_nothing_int, /* end_prologue */
debug_nothing_int, /* end_function */
debug_nothing_tree, /* function_decl */
debug_nothing_tree, /* global_decl */
- debug_nothing_tree /* deferred_inline_function */
+ debug_nothing_tree, /* deferred_inline_function */
+ debug_nothing_tree, /* outlining_inline_function */
+ debug_nothing_rtx /* label */
};
/* This file contains implementations of each debug hook that do
{
}
+bool
+debug_true_tree (block)
+ union tree_node *block ATTRIBUTE_UNUSED;
+{
+ return true;
+}
+
+void
+debug_nothing_rtx (insn)
+ struct rtx_def *insn ATTRIBUTE_UNUSED;
+{
+}
+
void
debug_nothing_charstar (main_filename)
const char *main_filename ATTRIBUTE_UNUSED;
#define GCC_DEBUG_H
union tree_node;
+struct rtx_def;
/* This structure contains hooks for the debug information output
functions, accessed through the global instance debug_hooks set in
/* Record the end of a block. Arguments as for begin_block. */
void (* end_block) PARAMS ((unsigned int line, unsigned int n));
+ /* Returns nonzero if it is appropriate not to emit any debugging
+ information for BLOCK, because it doesn't contain any
+ instructions. This may not be the case for blocks containing
+ nested functions, since we may actually call such a function even
+ though the BLOCK information is messed up. Defaults to true. */
+ bool (* ignore_block) PARAMS ((union tree_node *));
+
/* Record a source file location at (FILE, LINE). */
void (* source_line) PARAMS ((unsigned int line, const char *file));
/* DECL is an inline function, whose body is present, but which is
not being output at this point. */
void (* deferred_inline_function) PARAMS ((union tree_node *decl));
+
+ /* DECL is an inline function which is about to be emitted out of
+ line. The hook is useful to, e.g., emit abstract debug info for
+ the inline before it gets mangled by optimization. */
+ void (* outlining_inline_function) PARAMS ((union tree_node *decl));
+
+ /* Called from final_scan_insn for any CODE_LABEL insn whose
+ LABEL_NAME is non-null. */
+ void (* label) PARAMS ((struct rtx_def *insn));
};
extern struct gcc_debug_hooks *debug_hooks;
PARAMS ((unsigned int, unsigned int));
extern void debug_nothing_tree
PARAMS ((union tree_node *));
+extern bool debug_true_tree
+ PARAMS ((union tree_node *));
+extern void debug_nothing_rtx
+ PARAMS ((struct rtx_def *));
/* Hooks for various debug formats. */
extern struct gcc_debug_hooks do_nothing_debug_hooks;
PARAMS ((unsigned int, const char * file));
extern void dwarf2out_end_epilogue
PARAMS ((void));
+extern void dwarf2out_frame_init
+ PARAMS ((void));
+extern void dwarf2out_frame_finish
+ PARAMS ((void));
+/* Decide whether we want to emit frame unwind information for the current
+ translation unit. */
+extern int dwarf2out_do_frame
+ PARAMS ((void));
#endif /* !GCC_DEBUG_H */
static void dwarf2out_end_source_file PARAMS ((unsigned));
static void dwarf2out_begin_block PARAMS ((unsigned, unsigned));
static void dwarf2out_end_block PARAMS ((unsigned, unsigned));
+static bool dwarf2out_ignore_block PARAMS ((tree));
static void dwarf2out_global_decl PARAMS ((tree));
+static void dwarf2out_abstract_function PARAMS ((tree));
/* The debug hooks structure. */
dwarf2out_end_source_file,
dwarf2out_begin_block,
dwarf2out_end_block,
+ dwarf2out_ignore_block,
dwarf2out_source_line,
dwarf2out_begin_prologue,
debug_nothing_int, /* end_prologue */
debug_nothing_int, /* end_function */
dwarf2out_decl, /* function_decl */
dwarf2out_global_decl,
- debug_nothing_tree /* deferred_inline_function */
+ debug_nothing_tree, /* deferred_inline_function */
+ /* The DWARF 2 backend tries to reduce debugging bloat by not
+ emitting the abstract description of inline functions until
+ something tries to reference them. */
+ dwarf2out_abstract_function, /* outlining_inline_function */
+ debug_nothing_rtx /* label */
};
\f
/* NOTE: In the comments in this file, many references are made to
of a function which we may later generate inlined and/or
out-of-line instances of. */
-void
+static void
dwarf2out_abstract_function (decl)
tree decl;
{
as we would end up with orphans, and in the presence of scheduling
we may end up calling them anyway. */
-int
+static bool
dwarf2out_ignore_block (block)
tree block;
{
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-extern int dwarf2out_ignore_block PARAMS ((tree));
extern void dwarf2out_decl PARAMS ((tree));
-extern void dwarf2out_frame_init PARAMS ((void));
extern void dwarf2out_frame_debug PARAMS ((rtx));
-extern void dwarf2out_frame_finish PARAMS ((void));
extern void debug_dwarf PARAMS ((void));
struct die_struct;
extern void debug_dwarf_die PARAMS ((struct die_struct *));
extern void dwarf2out_set_demangle_name_func PARAMS ((const char *(*) (const char *)));
-extern void dwarf2out_abstract_function PARAMS ((tree));
extern void dwarf2out_add_library_unit_info PARAMS ((const char *, const char *));
extern unsigned current_funcdef_number;
dwarfout_end_source_file_check,
dwarfout_begin_block,
dwarfout_end_block,
+ debug_true_tree, /* ignore_block */
dwarfout_source_line, /* source_line */
dwarfout_source_line, /* begin_prologue */
dwarfout_end_prologue,
dwarfout_end_function,
dwarfout_function_decl,
dwarfout_global_decl,
- dwarfout_deferred_inline_function
+ dwarfout_deferred_inline_function,
+ debug_nothing_tree, /* outlining_inline_function */
+ debug_nothing_rtx /* label */
};
\f
/************************ general utility functions **************************/
#include "bitmap.h"
#include "basic-block.h"
#include "ggc.h"
+#include "debug.h"
/* Commonly used modes. */
if (NOTE_LINE_NUMBER (tmp) == NOTE_INSN_BLOCK_BEG)
{
- /* We just verified that this BLOCK matches us
- with the block_stack check above. */
- if (debug_ignore_block (NOTE_BLOCK (insn)))
+ /* We just verified that this BLOCK matches us with
+ the block_stack check above. Never delete the
+ BLOCK for the outermost scope of the function; we
+ can refer to names from that scope even if the
+ block notes are messed up. */
+ if (! is_body_block (NOTE_BLOCK (insn))
+ && (*debug_hooks->ignore_block) (NOTE_BLOCK (insn)))
{
remove_insn (tmp);
remove_insn (insn);
#include "target.h"
#include "debug.h"
-#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
-#include "dbxout.h"
-#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
-
-#ifdef XCOFF_DEBUGGING_INFO
-#include "xcoffout.h"
-#endif
-
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
#endif
-#ifdef SDB_DEBUGGING_INFO
-#include "sdbout.h"
-#endif
-
/* If we aren't using cc0, CC_STATUS_INIT shouldn't exist. So define a
null default for it to save conditionalization later. */
#ifndef CC_STATUS_INIT
FINAL_PRESCAN_INSN (insn, NULL, 0);
#endif
-#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG && LABEL_NAME (insn))
- sdbout_label (insn);
-#endif
+ if (LABEL_NAME (insn))
+ (*debug_hooks->label) (insn);
+
if (app_on)
{
fputs (ASM_APP_OFF, file);
/* Do any preparation, such as emitting abstract debug info for the inline
before it gets mangled by optimization. */
- note_outlining_of_inline_function (fndecl);
+ (*debug_hooks->outlining_inline_function) (fndecl);
/* Compile this function all the way down to assembly code. */
rest_of_compilation (fndecl);
static void sdbout_end_prologue PARAMS ((unsigned int));
static void sdbout_begin_function PARAMS ((tree));
static void sdbout_end_function PARAMS ((unsigned int));
+static void sdbout_toplevel_data PARAMS ((tree));
+static void sdbout_label PARAMS ((rtx));
static char *gen_fake_label PARAMS ((void));
static int plain_type PARAMS ((tree));
static int template_name_p PARAMS ((tree));
sdbout_end_source_file,
sdbout_begin_block,
sdbout_end_block,
+ debug_true_tree, /* ignore_block */
sdbout_source_line,
#ifdef MIPS_DEBUGGING_INFO
/* Defer on MIPS systems so that parameter descriptions follow
sdbout_end_function,
debug_nothing_tree, /* function_decl */
sdbout_global_decl,
- debug_nothing_tree /* deferred_inline_function */
+ debug_nothing_tree, /* deferred_inline_function */
+ debug_nothing_tree, /* outlining_inline_function */
+ sdbout_label
};
\f
#if 0
/* Output SDB information for a top-level initialized variable
that has been delayed. */
-void
+static void
sdbout_toplevel_data (decl)
tree decl;
{
/* Output sdb info for the given label. Called only if LABEL_NAME (insn)
is present. */
-void
+static void
sdbout_label (insn)
register rtx insn;
{
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-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));
#ifdef SDB_DEBUGGING_INFO
#include "sdbout.h"
#endif
-
-#ifdef XCOFF_DEBUGGING_INFO
-#include "xcoffout.h"
-#endif
\f
#ifdef VMS
/* The extra parameters substantially improve the I/O performance. */
timevar_pop (TV_SYMOUT);
}
-/* FNDECL is an inline function which is about to be emitted out of line.
- Do any preparation, such as emitting abstract debug info for the inline
- before it gets mangled by optimization. */
-
-void
-note_outlining_of_inline_function (fndecl)
- tree fndecl ATTRIBUTE_UNUSED;
-{
-#ifdef DWARF2_DEBUGGING_INFO
- /* The DWARF 2 backend tries to reduce debugging bloat by not emitting
- the abstract description of inline functions until something tries to
- reference them. Force it out now, before optimizations mangle the
- block tree. */
- if (write_symbols == DWARF2_DEBUG)
- dwarf2out_abstract_function (fndecl);
-#endif
-}
-
/* This is called from finish_function (within yyparse)
after each top-level definition is parsed.
It is supposed to compile that function or variable
fprintf (file, "%s", term);
}
-
-/* Returns nonzero if it is appropriate not to emit any debugging
- information for BLOCK, because it doesn't contain any instructions.
- This may not be the case for blocks containing nested functions, since
- we may actually call such a function even though the BLOCK information
- is messed up. */
-
-int
-debug_ignore_block (block)
- tree block ATTRIBUTE_UNUSED;
-{
- /* Never delete the BLOCK for the outermost scope
- of the function; we can refer to names from
- that scope even if the block notes are messed up. */
- if (is_body_block (block))
- return 0;
-
-#ifdef DWARF2_DEBUGGING_INFO
- if (write_symbols == DWARF2_DEBUG)
- return dwarf2out_ignore_block (block);
-#endif
-
- return 1;
-}
extern int count_error PARAMS ((int));
extern void strip_off_ending PARAMS ((char *, int));
extern void print_time PARAMS ((const char *, long));
-extern int debug_ignore_block PARAMS ((union tree_node *));
extern const char *trim_filename PARAMS ((const char *));
extern void internal_error PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1
extern int wrapup_global_declarations PARAMS ((union tree_node **, int));
extern void check_global_declarations PARAMS ((union tree_node **, int));
-extern void note_outlining_of_inline_function
- PARAMS ((union tree_node *));
extern const char *progname;
extern const char *dump_base_name;
\f
/* Interface of the DWARF2 unwind info support. */
-/* Decide whether we want to emit frame unwind information for the current
- translation unit. */
-
-extern int dwarf2out_do_frame PARAMS ((void));
-
/* Generate a new label for the CFI info to refer to. */
extern char *dwarf2out_cfi_label PARAMS ((void));