comparison gcc/lto-section-out.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* Functions for writing LTO sections. 1 /* Functions for writing LTO sections.
2 2
3 Copyright (C) 2009-2017 Free Software Foundation, Inc. 3 Copyright (C) 2009-2018 Free Software Foundation, Inc.
4 Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> 4 Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
8 GCC is free software; you can redistribute it and/or modify it under 8 GCC is free software; you can redistribute it and/or modify it under
28 #include "gimple.h" 28 #include "gimple.h"
29 #include "cgraph.h" 29 #include "cgraph.h"
30 #include "data-streamer.h" 30 #include "data-streamer.h"
31 #include "langhooks.h" 31 #include "langhooks.h"
32 #include "lto-compress.h" 32 #include "lto-compress.h"
33 #include "print-tree.h"
33 34
34 static vec<lto_out_decl_state_ptr> decl_state_stack; 35 static vec<lto_out_decl_state_ptr> decl_state_stack;
35 36
36 /* List of out decl states used by functions. We use this to 37 /* List of out decl states used by functions. We use this to
37 generate the decl directory later. */ 38 generate the decl directory later. */
64 void 65 void
65 lto_begin_section (const char *name, bool compress) 66 lto_begin_section (const char *name, bool compress)
66 { 67 {
67 lang_hooks.lto.begin_section (name); 68 lang_hooks.lto.begin_section (name);
68 69
70 if (streamer_dump_file)
71 {
72 if (flag_dump_unnumbered || flag_dump_noaddr)
73 fprintf (streamer_dump_file, "Creating %ssection\n",
74 compress ? "compressed " : "");
75 else
76 fprintf (streamer_dump_file, "Creating %ssection %s\n",
77 compress ? "compressed " : "", name);
78 }
69 gcc_assert (compression_stream == NULL); 79 gcc_assert (compression_stream == NULL);
70 if (compress) 80 if (compress)
71 compression_stream = lto_start_compression (lto_append_data, NULL); 81 compression_stream = lto_start_compression (lto_append_data, NULL);
72 } 82 }
73 83
156 unsigned int &index 166 unsigned int &index
157 = encoder->tree_hash_table->get_or_insert (name, &existed_p); 167 = encoder->tree_hash_table->get_or_insert (name, &existed_p);
158 if (!existed_p) 168 if (!existed_p)
159 { 169 {
160 index = encoder->trees.length (); 170 index = encoder->trees.length ();
171 if (streamer_dump_file)
172 {
173 print_node_brief (streamer_dump_file, " Encoding indexable ",
174 name, 4);
175 fprintf (streamer_dump_file, " as %i \n", index);
176 }
161 encoder->trees.safe_push (name); 177 encoder->trees.safe_push (name);
162 new_entry_p = TRUE; 178 new_entry_p = TRUE;
163 } 179 }
164 180
165 if (obs) 181 if (obs)