aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-07-19 06:22:04 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-07-19 06:22:04 +0000
commit2b85879e637df70ff99b3d7bbea2dd0997cc907f (patch)
treeb1d514bcbcb3022999013a3add1442cb71310221 /gcc/toplev.c
parentc60e94a70efc44dd419ec5119dad3aa7813949d3 (diff)
downloadgcc-2b85879e637df70ff99b3d7bbea2dd0997cc907f.zip
gcc-2b85879e637df70ff99b3d7bbea2dd0997cc907f.tar.gz
gcc-2b85879e637df70ff99b3d7bbea2dd0997cc907f.tar.bz2
Makefile.in (toplev.o, [...]): Don't depend on dwarfout.h.
* Makefile.in (toplev.o, dwarfout.o, final.o): Don't depend on dwarfout.h. * dbxout.c (dbxout_function): Rename dbxout_funciton_decl, move to conditionally compiled block. (dbx_debug_hooks, xcoff_debug_hooks): Update. * dbxout.h (dbxout_function): Remove. * debug.c (do_nothing_debug_hooks): Update. * debug.h (struct gcc_debug_hooks): New hooks function_decl, global_decl, deferred_inline_function. * dwarf2out.c (dwarf2_debug_hooks): Update. (dwarf2out_global_decl): New. * dwarfout.c: Don't include dwarfout.h. (dwarfout_global_decl, dwarfout_function_decl, dwarfout_deferred_inline_function): New. (dwarf_debug_hooks): Update. * dwarfout.h: Remove. * final.c: Don't include dwarfout.h. * sdbout.c (sdbout_global_decl): New. (sdbout_debug_hooks): Update. * toplev.c: Don't include dwarfout.h. (check_global_declarations, rest_of_compilation): Use new debug hooks. (note_deferral_of_defined_inline_function): Remove. * toplev.h (note_deferral_of_defined_inline_function): Remove. * ch/Makefile.in (lex.o): No dependence on dwarfout.h. * ch/lex.c: Don't include dwarfout.h. * cp/Make-lang.in (decl2.o): No dependence on dwarfout.h, dwarf2out.h. (semantics.o, optimize.o): Depend on debug.h not dwarfout.h. * cp/decl2.c: Don't include dwarfout.h and dwarf2out.h. * cp/optimize.c: Include debug.h. (maybe_clone_body): Use debug hook. * cp/semantics.c: Include debug.h. (expand_body): Use debug hook. * po/POTFILES.in: Remove dwarfout.h. From-SVN: r44145
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c103
1 files changed, 3 insertions, 100 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index e357d62..0e510b9 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -68,10 +68,6 @@ Boston, MA 02111-1307, USA. */
#include "integrate.h"
#include "debug.h"
-#ifdef DWARF_DEBUGGING_INFO
-#include "dwarfout.h"
-#endif
-
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
#endif
@@ -2059,47 +2055,7 @@ check_global_declarations (vec, len)
warning_with_decl (decl, "`%s' defined but not used");
timevar_push (TV_SYMOUT);
-#ifdef SDB_DEBUGGING_INFO
- /* The COFF linker can move initialized global vars to the end.
- And that can screw up the symbol ordering.
- By putting the symbols in that order to begin with,
- we avoid a problem. mcsun!unido!fauern!tumuc!pes@uunet.uu.net. */
- if (write_symbols == SDB_DEBUG && TREE_CODE (decl) == VAR_DECL
- && TREE_PUBLIC (decl) && DECL_INITIAL (decl)
- && ! DECL_EXTERNAL (decl)
- && DECL_RTL (decl) != 0)
- sdbout_symbol (decl, 0);
-
- /* Output COFF information for non-global
- file-scope initialized variables. */
- if (write_symbols == SDB_DEBUG
- && TREE_CODE (decl) == VAR_DECL
- && DECL_INITIAL (decl)
- && ! DECL_EXTERNAL (decl)
- && DECL_RTL (decl) != 0
- && GET_CODE (DECL_RTL (decl)) == MEM)
- sdbout_toplevel_data (decl);
-#endif /* SDB_DEBUGGING_INFO */
-#ifdef DWARF_DEBUGGING_INFO
- /* Output DWARF information for file-scope tentative data object
- declarations, file-scope (extern) function declarations (which
- had no corresponding body) and file-scope tagged type declarations
- and definitions which have not yet been forced out. */
-
- if (write_symbols == DWARF_DEBUG
- && (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)))
- dwarfout_file_scope_decl (decl, 1);
-#endif
-#ifdef DWARF2_DEBUGGING_INFO
- /* Output DWARF2 information for file-scope tentative data object
- declarations, file-scope (extern) function declarations (which
- had no corresponding body) and file-scope tagged type declarations
- and definitions which have not yet been forced out. */
-
- if (write_symbols == DWARF2_DEBUG
- && (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl)))
- dwarf2out_decl (decl);
-#endif
+ (*debug_hooks->global_decl) (decl);
timevar_pop (TV_SYMOUT);
}
}
@@ -2634,46 +2590,6 @@ rest_of_type_compilation (type, toplev)
timevar_pop (TV_SYMOUT);
}
-/* DECL is an inline function, whose body is present, but which is not
- being output at this point. (We're putting that off until we need
- to do it.) If there are any actions that need to take place,
- including the emission of debugging information for the function,
- this is where they should go. This function may be called by
- language-dependent code for front-ends that do not even generate
- RTL for functions that don't need to be put out. */
-
-void
-note_deferral_of_defined_inline_function (decl)
- tree decl ATTRIBUTE_UNUSED;
-{
-#ifdef DWARF_DEBUGGING_INFO
- /* Generate the DWARF info for the "abstract" instance of a function
- which we may later generate inlined and/or out-of-line instances
- of. */
- if (write_symbols == DWARF_DEBUG
- && (DECL_INLINE (decl) || DECL_ABSTRACT (decl))
- && ! DECL_ABSTRACT_ORIGIN (decl))
- {
- /* The front-end may not have set CURRENT_FUNCTION_DECL, but the
- DWARF code expects it to be set in this case. Intuitively,
- DECL is the function we just finished defining, so setting
- CURRENT_FUNCTION_DECL is sensible. */
- tree saved_cfd = current_function_decl;
- int was_abstract = DECL_ABSTRACT (decl);
- current_function_decl = decl;
-
- /* Let the DWARF code do its work. */
- set_decl_abstract_flags (decl, 1);
- dwarfout_file_scope_decl (decl, 0);
- if (! was_abstract)
- set_decl_abstract_flags (decl, 0);
-
- /* Reset CURRENT_FUNCTION_DECL. */
- current_function_decl = saved_cfd;
- }
-#endif
-}
-
/* 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. */
@@ -2822,7 +2738,7 @@ rest_of_compilation (decl)
declared inline but not inlined, and those inlined even
though they weren't declared inline. Conveniently, that's
what DECL_INLINE means at this point. */
- note_deferral_of_defined_inline_function (decl);
+ (*debug_hooks->deferred_inline_function) (decl);
if (DECL_DEFER_OUTPUT (decl))
{
@@ -3802,20 +3718,7 @@ rest_of_compilation (decl)
generated. During that call, we *will* be routed past here. */
timevar_push (TV_SYMOUT);
-#ifdef DBX_DEBUGGING_INFO
- if (write_symbols == DBX_DEBUG)
- dbxout_function (decl);
-#endif
-
-#ifdef DWARF_DEBUGGING_INFO
- if (write_symbols == DWARF_DEBUG)
- dwarfout_file_scope_decl (decl, 0);
-#endif
-
-#ifdef DWARF2_DEBUGGING_INFO
- if (write_symbols == DWARF2_DEBUG)
- dwarf2out_decl (decl);
-#endif
+ (*debug_hooks->function_decl) (decl);
timevar_pop (TV_SYMOUT);
exit_rest_of_compilation: