aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-07-22 17:02:53 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-07-22 17:02:53 +0000
commit3914abb46ef94ef60c9bb44c7e3573534c0c6815 (patch)
treef1f87373eb821207cc415143ba8c00551d90838c /gcc/varasm.c
parentbe7560ea81db88a710ff0915d8736b9dee2c9ad1 (diff)
downloadgcc-3914abb46ef94ef60c9bb44c7e3573534c0c6815.zip
gcc-3914abb46ef94ef60c9bb44c7e3573534c0c6815.tar.gz
gcc-3914abb46ef94ef60c9bb44c7e3573534c0c6815.tar.bz2
dbxout.c (dbxout_global_decl): New.
* dbxout.c (dbxout_global_decl): New. (xcoff_debug_hooks, dbx_debug_hooks): Use it. * sdbout.c (sdbout_finish): New. (sdbout_debug_hooks): Use it, add comments. (sdbout_global_decl): Defer initialised public vars to sdbout_finish. * varasm.c (assemble_variable): Don't output debug information for file-scope variables. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r44243
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c89
1 files changed, 7 insertions, 82 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 630dad0..7adae8e 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1232,44 +1232,6 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
last_assemble_variable_decl = 0;
- if (DECL_RTL_SET_P (decl) && GET_CODE (DECL_RTL (decl)) == REG)
- {
- /* Do output symbol info for global register variables, but do nothing
- else for them. */
-
- if (TREE_ASM_WRITTEN (decl))
- return;
- TREE_ASM_WRITTEN (decl) = 1;
-
- /* Do no output if -fsyntax-only. */
- if (flag_syntax_only)
- return;
-
-#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
- /* File-scope global variables are output here. */
- if ((write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
- && top_level)
- dbxout_symbol (decl, 0);
-#endif
-#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG && top_level
- /* Leave initialized global vars for end of compilation;
- see comment in compile_file. */
- && (TREE_PUBLIC (decl) == 0 || DECL_INITIAL (decl) == 0))
- sdbout_symbol (decl, 0);
-#endif
-
- /* Don't output any DWARF debugging information for variables here.
- In the case of local variables, the information for them is output
- when we do our recursive traversal of the tree representation for
- the entire containing function. In the case of file-scope variables,
- we output information for all of them at the very end of compilation
- while we are doing our final traversal of the chain of file-scope
- declarations. */
-
- return;
- }
-
/* Normally no need to say anything here for external references,
since assemble_external is called by the language-specific code
when a declaration is first seen. */
@@ -1283,6 +1245,13 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
if (TREE_CODE (decl) == FUNCTION_DECL)
return;
+ /* Do nothing for global register variables. */
+ if (DECL_RTL_SET_P (decl) && GET_CODE (DECL_RTL (decl)) == REG)
+ {
+ TREE_ASM_WRITTEN (decl) = 1;
+ return;
+ }
+
/* If type was incomplete when the variable was declared,
see if it is complete now. */
@@ -1411,27 +1380,6 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
(decl, "requested alignment for %s is greater than implemented alignment of %d.",rounded);
#endif
-#ifdef DBX_DEBUGGING_INFO
- /* File-scope global variables are output here. */
- if (write_symbols == DBX_DEBUG && top_level)
- dbxout_symbol (decl, 0);
-#endif
-#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG && top_level
- /* Leave initialized global vars for end of compilation;
- see comment in compile_file. */
- && (TREE_PUBLIC (decl) == 0 || DECL_INITIAL (decl) == 0))
- sdbout_symbol (decl, 0);
-#endif
-
- /* Don't output any DWARF debugging information for variables here.
- In the case of local variables, the information for them is output
- when we do our recursive traversal of the tree representation for
- the entire containing function. In the case of file-scope variables,
- we output information for all of them at the very end of compilation
- while we are doing our final traversal of the chain of file-scope
- declarations. */
-
#if 0 /* ??? We should either delete this or add a comment describing what
it was intended to do and why we shouldn't delete it. */
if (flag_shared_data)
@@ -1494,29 +1442,6 @@ assemble_variable (decl, top_level, at_end, dont_output_data)
/* Record current section so we can restore it if dbxout.c clobbers it. */
saved_in_section = in_section;
- /* Output the dbx info now that we have chosen the section. */
-
-#ifdef DBX_DEBUGGING_INFO
- /* File-scope global variables are output here. */
- if (write_symbols == DBX_DEBUG && top_level)
- dbxout_symbol (decl, 0);
-#endif
-#ifdef SDB_DEBUGGING_INFO
- if (write_symbols == SDB_DEBUG && top_level
- /* Leave initialized global vars for end of compilation;
- see comment in compile_file. */
- && (TREE_PUBLIC (decl) == 0 || DECL_INITIAL (decl) == 0))
- sdbout_symbol (decl, 0);
-#endif
-
- /* Don't output any DWARF debugging information for variables here.
- In the case of local variables, the information for them is output
- when we do our recursive traversal of the tree representation for
- the entire containing function. In the case of file-scope variables,
- we output information for all of them at the very end of compilation
- while we are doing our final traversal of the chain of file-scope
- declarations. */
-
/* If the debugging output changed sections, reselect the section
that's supposed to be selected. */
if (in_section != saved_in_section)