]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/lto-section-out.c
c++: Handle multiple aggregate overloads [PR95319].
[thirdparty/gcc.git] / gcc / lto-section-out.c
index f547cc3b62c6a168cf8bc2167c3b655689f954b5..0182cd6059ef0093ac75c2fe25cdcb8adbd8c786 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions for writing LTO sections.
 
-   Copyright (C) 2009-2015 Free Software Foundation, Inc.
+   Copyright (C) 2009-2020 Free Software Foundation, Inc.
    Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
 
 This file is part of GCC.
@@ -30,6 +30,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "data-streamer.h"
 #include "langhooks.h"
 #include "lto-compress.h"
+#include "print-tree.h"
 
 static vec<lto_out_decl_state_ptr> decl_state_stack;
 
@@ -66,6 +67,15 @@ lto_begin_section (const char *name, bool compress)
 {
   lang_hooks.lto.begin_section (name);
 
+  if (streamer_dump_file)
+    {
+      if (flag_dump_unnumbered || flag_dump_noaddr)
+         fprintf (streamer_dump_file, "Creating %ssection\n",
+                  compress ? "compressed " : "");
+       else
+         fprintf (streamer_dump_file, "Creating %ssection %s\n",
+                  compress ? "compressed " : "", name);
+    }
   gcc_assert (compression_stream == NULL);
   if (compress)
     compression_stream = lto_start_compression (lto_append_data, NULL);
@@ -158,6 +168,12 @@ lto_output_decl_index (struct lto_output_stream *obs,
   if (!existed_p)
     {
       index = encoder->trees.length ();
+      if (streamer_dump_file)
+       {
+         print_node_brief (streamer_dump_file, "     Encoding indexable ",
+                           name, 4);
+         fprintf (streamer_dump_file, "  as %i \n", index);
+       }
       encoder->trees.safe_push (name);
       new_entry_p = TRUE;
     }
@@ -262,15 +278,13 @@ lto_destroy_simple_output_block (struct lto_simple_output_block *ob)
   char *section_name;
   struct lto_simple_header header;
 
-  section_name = lto_get_section_name (ob->section_type, NULL, NULL);
+  section_name = lto_get_section_name (ob->section_type, NULL, 0, NULL);
   lto_begin_section (section_name, !flag_wpa);
   free (section_name);
 
   /* Write the header which says how to decode the pieces of the
      t.  */
   memset (&header, 0, sizeof (struct lto_simple_header));
-  header.major_version = LTO_major_version;
-  header.minor_version = LTO_minor_version;
   header.main_size = ob->main_stream->total_size;
   lto_write_data (&header, sizeof header);