aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zack@codesourcery.com>2004-02-19 17:21:14 +0000
committerZack Weinberg <zack@gcc.gnu.org>2004-02-19 17:21:14 +0000
commit16edbbf082fd2fbabe92ddbb20ffc2d9f757ce75 (patch)
tree7cefc1b666ecb878267cad1f2635c359a3e678a1
parentf46e5baad61a5604120e22c7dfa3b77180f2e7ef (diff)
downloadgcc-16edbbf082fd2fbabe92ddbb20ffc2d9f757ce75.zip
gcc-16edbbf082fd2fbabe92ddbb20ffc2d9f757ce75.tar.gz
gcc-16edbbf082fd2fbabe92ddbb20ffc2d9f757ce75.tar.bz2
sdbout.c (preinit_symbols, [...]): New statics.
* sdbout.c (preinit_symbols, sdbout_initialized): New statics. (sdbout_symbol): If called before sdbout_init, queue DECL for later and return. (sdbout_init): Set sdbout_initialized true, process decls queued earlier by sdbout_symbol. (sdbout_finish): Use size_t for index variable. From-SVN: r78109
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/sdbout.c27
2 files changed, 37 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f9fa2d3..7641ece 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,14 @@
+2004-02-19 Zack Weinberg <zack@codesourcery.com>
+
+ * sdbout.c (preinit_symbols, sdbout_initialized): New statics.
+ (sdbout_symbol): If called before sdbout_init, queue DECL for
+ later and return.
+ (sdbout_init): Set sdbout_initialized true, process decls
+ queued earlier by sdbout_symbol.
+ (sdbout_finish): Use size_t for index variable.
+
2004-02-19 Jeff Law <law@redhat.com>
-
+
* fold-const.c (invert_truthvalue): Do not call invert_tree_comparison
for unordered comparison codes.
@@ -102,7 +111,7 @@
defined. Instead use REAL_LIBGCC_SPEC, unmodifed, as the libgcc
spec string.
* doc/tm.texi (REAL_LIBGCC_SPEC): Document.
-
+
2004-02-18 Zack Weinberg <zack@codesourcery.com>
* dwarf2out.c (loclabel_num): Move outside #ifdef
diff --git a/gcc/sdbout.c b/gcc/sdbout.c
index ed6b468..7f6a398 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -64,6 +64,13 @@ static GTY(()) int unnamed_struct_number;
static GTY(()) varray_type deferred_global_decls;
+/* The C front end may call sdbout_symbol before sdbout_init runs.
+ We save all such decls in this list and output them when we get
+ to sdbout_init. */
+
+static GTY(()) tree preinit_symbols;
+static GTY(()) bool sdbout_initialized;
+
#ifdef SDB_DEBUGGING_INFO
#include "rtl.h"
@@ -699,6 +706,14 @@ sdbout_symbol (tree decl, int local)
int regno = -1;
const char *name;
+ /* If we are called before sdbout_init is run, just save the symbol
+ for later. */
+ if (!sdbout_initialized)
+ {
+ preinit_symbols = tree_cons (0, decl, preinit_symbols);
+ return;
+ }
+
sdbout_one_type (type);
switch (TREE_CODE (decl))
@@ -1460,7 +1475,7 @@ sdbout_global_decl (tree decl)
static void
sdbout_finish (const char *main_filename ATTRIBUTE_UNUSED)
{
- int i;
+ size_t i;
for (i = 0; i < VARRAY_ACTIVE_SIZE (deferred_global_decls); i++)
sdbout_symbol (VARRAY_TREE (deferred_global_decls, i), 0);
@@ -1663,6 +1678,8 @@ sdbout_end_source_file (unsigned int line ATTRIBUTE_UNUSED)
static void
sdbout_init (const char *input_file_name ATTRIBUTE_UNUSED)
{
+ tree t;
+
#ifdef MIPS_DEBUGGING_INFO
current_file = xmalloc (sizeof *current_file);
current_file->next = NULL;
@@ -1670,6 +1687,14 @@ sdbout_init (const char *input_file_name ATTRIBUTE_UNUSED)
#endif
VARRAY_TREE_INIT (deferred_global_decls, 12, "deferred_global_decls");
+
+ /* Emit debug information which was queued by sdbout_symbol before
+ we got here. */
+ sdbout_initialized = true;
+
+ for (t = nreverse (preinit_symbols); t; t = TREE_CHAIN (t))
+ sdbout_symbol (TREE_VALUE (t), 0);
+ preinit_symbols = 0;
}
#else /* SDB_DEBUGGING_INFO */