aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-09-28 14:31:04 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-09-28 14:31:04 +0000
commitb23d063b5282827b499d22365b675544e55769da (patch)
tree0c1f9e39090786c42190641d1ba2aa4faf2199d2
parent8fd57d049ffe9220c16b662a434578fb77bec047 (diff)
downloadgcc-b23d063b5282827b499d22365b675544e55769da.zip
gcc-b23d063b5282827b499d22365b675544e55769da.tar.gz
gcc-b23d063b5282827b499d22365b675544e55769da.tar.bz2
dwarf2out.c (cu_die_list): New global.
2016-09-27 Richard Biener <rguenther@suse.de> * dwarf2out.c (cu_die_list): New global. (dwarf2out_finish): Walk cu_die_list instead of limbo DIEs. Add main_comp_unit_die to cu_die_list if we created it. Move break_out_includes ... (dwarf2out_early_finish): ... here. Push created CU DIEs onto the cu_die_list. From-SVN: r240579
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/dwarf2out.c37
2 files changed, 38 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c03ac53..3c70860 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2016-09-27 Richard Biener <rguenther@suse.de>
+
+ * dwarf2out.c (cu_die_list): New global.
+ (dwarf2out_finish): Walk cu_die_list instead of limbo DIEs. Add
+ main_comp_unit_die to cu_die_list if we created it.
+ Move break_out_includes ...
+ (dwarf2out_early_finish): ... here. Push created CU DIEs onto
+ the cu_die_list.
+
2016-09-28 Richard Biener <rguenther@suse.de>
* dwarf2out.c (struct die_struct): Add removed flag.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b6d6ace..972da16 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -2866,6 +2866,9 @@ static GTY(()) dw_die_ref single_comp_unit_die;
/* A list of type DIEs that have been separated into comdat sections. */
static GTY(()) comdat_type_node *comdat_type_list;
+/* A list of CU DIEs that have been separated. */
+static GTY(()) limbo_die_node *cu_die_list;
+
/* A list of DIEs with a NULL parent waiting to be relocated. */
static GTY(()) limbo_die_node *limbo_die_list;
@@ -27855,11 +27858,6 @@ dwarf2out_finish (const char *)
resolve_addr (comp_unit_die ());
move_marked_base_types ();
- /* Generate separate CUs for each of the include files we've seen.
- They will go into limbo_die_list. */
- if (flag_eliminate_dwarf2_dups)
- break_out_includes (comp_unit_die ());
-
/* Initialize sections and labels used for actual assembler output. */
init_sections_and_labels ();
@@ -27867,7 +27865,7 @@ dwarf2out_finish (const char *)
have children. */
add_sibling_attributes (comp_unit_die ());
limbo_die_node *node;
- for (node = limbo_die_list; node; node = node->next)
+ for (node = cu_die_list; node; node = node->next)
add_sibling_attributes (node->die);
for (ctnode = comdat_type_list; ctnode != NULL; ctnode = ctnode->next)
add_sibling_attributes (ctnode->root_die);
@@ -27876,7 +27874,15 @@ dwarf2out_finish (const char *)
skeleton compile_unit DIE that remains in the .o, while
most attributes go in the DWO compile_unit_die. */
if (dwarf_split_debug_info)
- main_comp_unit_die = gen_compile_unit_die (NULL);
+ {
+ limbo_die_node *cu;
+ main_comp_unit_die = gen_compile_unit_die (NULL);
+ cu = limbo_die_list;
+ gcc_assert (cu->die == main_comp_unit_die);
+ limbo_die_list = limbo_die_list->next;
+ cu->next = cu_die_list;
+ cu_die_list = cu;
+ }
else
main_comp_unit_die = comp_unit_die ();
@@ -27988,7 +27994,7 @@ dwarf2out_finish (const char *)
/* Output all of the compilation units. We put the main one last so that
the offsets are available to output_pubnames. */
- for (node = limbo_die_list; node; node = node->next)
+ for (node = cu_die_list; node; node = node->next)
output_comp_unit (node->die, 0);
hash_table<comdat_type_hasher> comdat_type_table (100);
@@ -28217,6 +28223,21 @@ dwarf2out_early_finish (const char *filename)
prune_unused_types ();
}
+ /* Generate separate CUs for each of the include files we've seen.
+ They will go into limbo_die_list and from there to cu_die_list. */
+ if (flag_eliminate_dwarf2_dups)
+ {
+ gcc_assert (limbo_die_list == NULL);
+ break_out_includes (comp_unit_die ());
+ limbo_die_node *cu;
+ while ((cu = limbo_die_list))
+ {
+ limbo_die_list = cu->next;
+ cu->next = cu_die_list;
+ cu_die_list = cu;
+ }
+ }
+
/* The early debug phase is now finished. */
early_dwarf_finished = true;
}