aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-06-03 02:31:22 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-06-02 22:31:22 -0400
commit8a8c36562fddd1dcaf5ebc8dee47d7cb20bc7a88 (patch)
tree686d716a425f3c3ba8a4f21bec3493ff9dda1c1d
parentec1f6a38efe6ad810d21c5f1dc2dbb2093c8277d (diff)
downloadgcc-8a8c36562fddd1dcaf5ebc8dee47d7cb20bc7a88.zip
gcc-8a8c36562fddd1dcaf5ebc8dee47d7cb20bc7a88.tar.gz
gcc-8a8c36562fddd1dcaf5ebc8dee47d7cb20bc7a88.tar.bz2
dwarf2out.c (add_incomplete_type): New fn.
* dwarf2out.c (add_incomplete_type): New fn. (gen_struct_or_union_type_die): Call it. (retry_incomplete_types): New fn. (dwarf2out_finish): Call it. From-SVN: r27325
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/dwarf2out.c58
2 files changed, 64 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8543d0a..935980a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Thu Jun 3 02:15:07 1999 Jason Merrill <jason@yorick.cygnus.com>
+
+ * dwarf2out.c (add_incomplete_type): New fn.
+ (gen_struct_or_union_type_die): Call it.
+ (retry_incomplete_types): New fn.
+ (dwarf2out_finish): Call it.
+
Thu Jun 3 01:19:03 1999 Jeffrey A Law (law@cygnus.com)
* gcse.c (insert_insn_end_bb): Correct placement of insns when the
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 58cf338..f75d2c1 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2426,6 +2426,22 @@ static unsigned pending_types;
be enough for most typical programs. */
#define PENDING_TYPES_INCREMENT 64
+/* A pointer to the base of a list of incomplete types which might be
+ completed at some later time. */
+
+static tree *incomplete_types_list;
+
+/* Number of elements currently allocated for the incomplete_types_list. */
+static unsigned incomplete_types_allocated;
+
+/* Number of elements of incomplete_types_list currently in use. */
+static unsigned incomplete_types;
+
+/* Size (in elements) of increments by which we may expand the incomplete
+ types list. Actually, a single hunk of space of this size should
+ be enough for most typical programs. */
+#define INCOMPLETE_TYPES_INCREMENT 64
+
/* Record whether the function being analyzed contains inlined functions. */
static int current_function_has_inlines;
#if 0 && defined (MIPS_DEBUGGING_INFO)
@@ -8035,6 +8051,39 @@ output_pending_types_for_scope (context_die)
}
}
+/* Remember a type in the incomplete_types_list. */
+
+static void
+add_incomplete_type (type)
+ tree type;
+{
+ if (incomplete_types == incomplete_types_allocated)
+ {
+ incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
+ incomplete_types_list
+ = (tree *) xrealloc (incomplete_types_list,
+ sizeof (tree) * incomplete_types_allocated);
+ }
+
+ incomplete_types_list[incomplete_types++] = type;
+}
+
+/* Walk through the list of incomplete types again, trying once more to
+ emit full debugging info for them. */
+
+static void
+retry_incomplete_types ()
+{
+ register tree type;
+
+ while (incomplete_types)
+ {
+ --incomplete_types;
+ type = incomplete_types_list[incomplete_types];
+ gen_type_die (type, comp_unit_die);
+ }
+}
+
/* Generate a DIE to represent an inlined instance of an enumeration type. */
static void
@@ -9026,7 +9075,10 @@ gen_struct_or_union_type_die (type, context_die)
}
}
else
- add_AT_flag (type_die, DW_AT_declaration, 1);
+ {
+ add_AT_flag (type_die, DW_AT_declaration, 1);
+ add_incomplete_type (type);
+ }
}
/* Generate a DIE for a subroutine _type_. */
@@ -9995,6 +10047,10 @@ dwarf2out_finish ()
free (node);
}
+ /* Walk through the list of incomplete types again, trying once more to
+ emit full debugging info for them. */
+ retry_incomplete_types ();
+
/* Traverse the DIE tree and add sibling attributes to those DIE's
that have children. */
add_sibling_attributes (comp_unit_die);