GCC Middle and Back End API Reference
lto-streamer.h
Go to the documentation of this file.
1/* Data structures and declarations used for reading and writing
2 GIMPLE to a file stream.
3
4 Copyright (C) 2009-2024 Free Software Foundation, Inc.
5 Contributed by Doug Kwan <dougkwan@google.com>
6
7This file is part of GCC.
8
9GCC is free software; you can redistribute it and/or modify it under
10the terms of the GNU General Public License as published by the Free
11Software Foundation; either version 3, or (at your option) any later
12version.
13
14GCC is distributed in the hope that it will be useful, but WITHOUT ANY
15WARRANTY; without even the implied warranty of MERCHANTABILITY or
16FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17for more details.
18
19You should have received a copy of the GNU General Public License
20along with GCC; see the file COPYING3. If not see
21<http://www.gnu.org/licenses/>. */
22
23#ifndef GCC_LTO_STREAMER_H
24#define GCC_LTO_STREAMER_H
25
26#include "plugin-api.h"
27#include "gcov-io.h"
28#include "diagnostic.h"
29#include "version.h"
30
31/* The encoding for a function consists of the following sections:
32
33 1) The header.
34 2) FIELD_DECLS.
35 3) FUNCTION_DECLS.
36 4) global VAR_DECLS.
37 5) type_decls
38 6) types.
39 7) Names for the labels that have names
40 8) The SSA names.
41 9) The control flow graph.
42 10-11)Gimple for local decls.
43 12) Gimple for the function.
44 13) Strings.
45
46 1) THE HEADER.
47 2-6) THE GLOBAL DECLS AND TYPES.
48
49 The global decls and types are encoded in the same way. For each
50 entry, there is word with the offset within the section to the
51 entry.
52
53 7) THE LABEL NAMES.
54
55 Since most labels do not have names, this section my be of zero
56 length. It consists of an array of string table references, one
57 per label. In the lto code, the labels are given either
58 positive or negative indexes. the positive ones have names and
59 the negative ones do not. The positive index can be used to
60 find the name in this array.
61
62 9) THE CFG.
63
64 10) Index into the local decls. Since local decls can have local
65 decls inside them, they must be read in randomly in order to
66 properly restore them.
67
68 11-12) GIMPLE FOR THE LOCAL DECLS AND THE FUNCTION BODY.
69
70 The gimple consists of a set of records.
71
72 THE FUNCTION
73
74 At the top level of (8) is the function. It consists of five
75 pieces:
76
77 LTO_function - The tag.
78 eh tree - This is all of the exception handling regions
79 put out in a post order traversial of the
80 tree. Siblings are output as lists terminated
81 by a 0. The set of fields matches the fields
82 defined in except.cc.
83
84 last_basic_block - in uleb128 form.
85
86 basic blocks - This is the set of basic blocks.
87
88 zero - The termination of the basic blocks.
89
90 BASIC BLOCKS
91
92 There are two forms of basic blocks depending on if they are
93 empty or not.
94
95 The basic block consists of:
96
97 LTO_bb1 or LTO_bb0 - The tag.
98
99 bb->index - the index in uleb128 form.
100
101 #succs - The number of successors un uleb128 form.
102
103 the successors - For each edge, a pair. The first of the
104 pair is the index of the successor in
105 uleb128 form and the second are the flags in
106 uleb128 form.
107
108 the statements - A gimple tree, as described above.
109 These are only present for LTO_BB1.
110 Following each statement is an optional
111 exception handling record LTO_eh_region
112 which contains the region number (for
113 regions >= 0).
114
115 zero - This is only present for LTO_BB1 and is used
116 to terminate the statements and exception
117 regions within this block.
118
119 12) STRINGS
120
121 String are represented in the table as pairs, a length in ULEB128
122 form followed by the data for the string. */
123
124#define LTO_major_version GCC_major_version
125#define LTO_minor_version 0
126
127typedef unsigned char lto_decl_flags_t;
128
129/* Tags representing the various IL objects written to the bytecode file
130 (GIMPLE statements, basic blocks, EH regions, tree nodes, etc).
131
132 NOTE, when adding new LTO tags, also update lto_tag_name. */
134{
136
137 /* Reference to previously-streamed node. */
139
140 /* References to indexable tree nodes. These objects are stored in
141 tables that are written separately from the function bodies
142 and variable constructors that reference them. This way they can be
143 instantiated even when the referencing functions aren't (e.g., during WPA)
144 and it also allows functions to be copied from one file to another without
145 having to unpickle the body first (the references are location
146 independent). */
148
150
151 /* Special for global streamer. A blob of unnamed tree nodes. */
153
154 /* Sequence of trees. */
156
157 /* Shared INTEGER_CST node. */
159
160 /* Tags of trees are encoded as
161 LTO_first_tree_tag + TREE_CODE. */
163 /* Tags of gimple typles are encoded as
164 LTO_first_gimple_tag + gimple_code. */
166
167 /* Entry and exit basic blocks. */
170
171 /* EH region holding the previous statement. */
173
174 /* Function body. */
176
177 /* EH table. */
179
180 /* EH region types. These mirror enum eh_region_type. */
185
186 /* EH landing pad. */
188
189 /* EH try/catch node. */
191
192 /* This tag must always be last. */
195
196
197/* Set of section types that are in an LTO file. This list will grow
198 as the number of IPA passes grows since each IPA pass will need its
199 own section type to store its summary information.
200
201 When adding a new section type, you must also extend the
202 LTO_SECTION_NAME array in lto-section-in.cc. */
230
231/* Indices to the various function, type and symbol streams. */
233{
234 LTO_DECL_STREAM = 0, /* Must be first. */
237
238typedef enum ld_plugin_symbol_resolution ld_plugin_symbol_resolution_t;
239
240/* Return a char pointer to the start of a data stream for an lto pass
241 or function. The first parameter is the file data that contains
242 the information. The second parameter is the type of information
243 to be obtained. The third parameter is the name of the function
244 and is only used when finding a function body; otherwise it is
245 NULL. The fourth parameter is the length of the data returned. */
246typedef const char* (lto_get_section_data_f) (struct lto_file_decl_data *,
247 enum lto_section_type,
248 const char *,
249 int,
250 size_t *);
251
252/* Return the data found from the above call. The first three
253 parameters are the same as above. The fourth parameter is the data
254 itself and the fifth is the length of the data. */
256 enum lto_section_type,
257 const char *,
258 const char *,
259 size_t);
260
261/* The location cache holds expanded locations for streamed in trees.
262 This is done to reduce memory usage of libcpp linemap that strongly prefers
263 locations to be inserted in the source order. */
264
266{
267public:
268 /* Apply all changes in location cache. Add locations into linemap and patch
269 trees. */
270 bool apply_location_cache ();
271 /* Tree merging did not suceed; mark all changes in the cache as accepted. */
272 void accept_location_cache ();
273 /* Tree merging did suceed; throw away recent changes. */
274 void revert_location_cache ();
275 void input_location (location_t *loc, struct bitpack_d *bp,
276 class data_in *data_in);
277 void input_location_and_block (location_t *loc, struct bitpack_d *bp,
278 class lto_input_block *ib,
279 class data_in *data_in);
294
295 /* There can be at most one instance of location cache (combining multiple
296 would bring it out of sync with libcpp linemap); point to current
297 one. */
299
300private:
301 static int cmp_loc (const void *pa, const void *pb);
302
304 {
305 const char *file;
306 location_t *loc;
307 int line, col;
308 bool sysp;
310 unsigned discr;
311 };
312
313 /* The location cache. */
314
316
317 /* Accepted entries are ones used by trees that are known to be not unified
318 by tree merging. */
319
321
322 /* Bookkeeping to remember state in between calls to lto_apply_location_cache
323 When streaming gimple, the location cache is not used and thus
324 lto_apply_location_cache happens per location basis. It is then
325 useful to avoid redundant calls of linemap API. */
326
327 const char *current_file;
331 location_t current_loc;
334};
335
336/* Structure used as buffer for reading an LTO file. */
338{
339public:
340 /* Special constructor for the string table, it abuses this to
341 do random access but use the uhwi decoder. */
342 lto_input_block (const char *data_, unsigned int p_, unsigned int len_,
343 const lto_file_decl_data *file_data_)
344 : data (data_), file_data (file_data_), p (p_), len (len_) {}
345 lto_input_block (const char *data_, unsigned int len_,
346 const lto_file_decl_data *file_data_)
347 : data (data_), file_data (file_data_), p (0), len (len_) {}
348
349 const char *data;
351 unsigned int p;
352 unsigned int len;
353};
354
355/* Compression algorithm used for compression of LTO bytecode. */
356
362
363/* Structure that represents LTO ELF section with information
364 about the format. */
365
367{
370 unsigned char slim_object;
371 unsigned char _padding;
372
373 /* Flags is a private field that is not defined publicly. */
374 uint16_t flags;
375
376 /* Set compression to FLAGS. */
378 {
379 flags = c;
380 }
381
382 /* Get compression from FLAGS. */
384 {
385 return (lto_compression) flags;
386 }
387};
388
390
391/* The is the first part of the record in an LTO file for many of the
392 IPA passes. */
394{
395 /* Size of main gimple body of function. */
396 int32_t main_size;
397};
398
400{
401 /* Size of the string table. */
402 int32_t string_size;
403};
404
405/* The header for a function body. */
407{
408 /* Size of the cfg. */
409 int32_t cfg_size;
410};
411
412
413/* Structure describing a symbol section. */
415{
416 /* Size of region for decl state. */
418
419 /* Number of nodes in globals stream. */
420 int32_t num_nodes;
421};
422
423
424/* Statistics gathered during LTO, WPA and LTRANS. */
426{
427 unsigned HOST_WIDE_INT num_input_cgraph_nodes;
428 unsigned HOST_WIDE_INT num_output_symtab_nodes;
429 unsigned HOST_WIDE_INT num_input_files;
430 unsigned HOST_WIDE_INT num_output_files;
431 unsigned HOST_WIDE_INT num_cgraph_partitions;
432 unsigned HOST_WIDE_INT section_size[LTO_N_SECTION_TYPES];
433 unsigned HOST_WIDE_INT num_function_bodies;
434 unsigned HOST_WIDE_INT num_trees[NUM_TREE_CODES];
435 unsigned HOST_WIDE_INT num_output_il_bytes;
436 unsigned HOST_WIDE_INT num_compressed_il_bytes;
437 unsigned HOST_WIDE_INT num_input_il_bytes;
438 unsigned HOST_WIDE_INT num_uncompressed_il_bytes;
439 unsigned HOST_WIDE_INT num_tree_bodies_output;
440 unsigned HOST_WIDE_INT num_pickle_refs_output;
441};
442
443/* Entry of LTO symtab encoder. */
445{
447 /* Is the node in this partition (i.e. ltrans of this partition will
448 be responsible for outputting it)? */
449 unsigned int in_partition:1;
450 /* Do we encode body in this partition? */
451 unsigned int body:1;
452 /* Do we encode initializer in this partition?
453 For example the readonly variable initializers are encoded to aid
454 constant folding even if they are not in the partition. */
455 unsigned int initializer:1;
456};
457
458
459/* Encoder data structure used to stream callgraph nodes. */
465
467
468/* Iterator structure for cgraph node sets. */
474
475
476
477/* The lto_tree_ref_encoder struct is used to encode trees into indices. */
478
480{
481 hash_map<tree, unsigned> *tree_hash_table; /* Maps pointers to indices. */
482 vec<tree> trees; /* Maps indices to pointers. */
483};
484
485
486/* Structure to hold states of input scope. */
487struct GTY((for_user)) lto_in_decl_state
488{
489 /* Array of lto_in_decl_buffers to store type and decls streams. */
491
492 /* If this in-decl state is associated with a function. FN_DECL
493 point to the FUNCTION_DECL. */
495
496 /* True if decl state is compressed. */
498};
499
501
502struct decl_state_hasher : ggc_ptr_hash<lto_in_decl_state>
503{
504 static hashval_t
506 {
507 return htab_hash_pointer (s->fn_decl);
508 }
509
510 static bool
512 {
513 return a->fn_decl == b->fn_decl;
514 }
515};
516
517/* The structure that holds all of the vectors of global types,
518 decls and cgraph nodes used in the serialization of this file. */
520{
521 /* The buffers contain the sets of decls of various kinds and types we have
522 seen so far and the indexes assigned to them. */
524
525 /* Encoder for cgraph nodes. */
527
528 /* If this out-decl state belongs to a function, fn_decl points to that
529 function. Otherwise, it is NULL. */
531
532 /* True if decl state is compressed. */
534};
535
537
538
539/* Compact representation of a index <-> resolution pair. Unpacked to an
540 vector later. */
546
547
548/* One of these is allocated for each object file that being compiled
549 by lto. This structure contains the tables that are needed by the
550 serialized functions and ipa passes to connect themselves to the
551 global types and decls as they are reconstituted. */
553{
554 /* Decl state currently used. */
556
557 /* Decl state corresponding to regions outside of any functions
558 in the compilation unit. */
560
561 /* Table of cgraph nodes present in this file. */
563
564 /* Hash table maps lto-related section names to location in file. */
566
567 /* The .o file that these offsets relate to. */
568 const char *GTY((skip)) file_name;
569
570 /* Hash table maps lto-related section names to location in file. */
571 htab_t GTY((skip)) section_hash_table;
572
573 /* Hash new name of renamed global declaration to its original name. */
574 htab_t GTY((skip)) renaming_hash_table;
575
576 /* Linked list used temporarily in reader */
578
579 /* Order in which the file appears on the command line. */
580 int order;
581
582 /* Sub ID for merged objects. */
583 unsigned HOST_WIDE_INT id;
584
585 /* Symbol resolutions for this file */
587 unsigned max_index;
588
590
591 /* Map assigning declarations their resolutions. */
593
594 /* Mode translation table. */
595 const unsigned char *mode_table;
596
597 /* Read LTO section. */
599
601
603
604 unsigned mode_bits;
605};
606
608
610{
611 char *ptr;
612};
613
614/* An incore byte stream to buffer the various parts of the function.
615 The entire structure should be zeroed when created. The record
616 consists of a set of blocks. The first sizeof (ptr) bytes are used
617 as a chain, and the rest store the bytes to be written. */
619{
620 /* The pointer to the first block in the stream. */
622
623 /* The pointer to the last and current block in the stream. */
625
626 /* The pointer to where the next char should be written. */
628
629 /* The number of characters left in the current block. */
630 unsigned int left_in_block;
631
632 /* The block size of the last block allocated. */
633 unsigned int block_size;
634
635 /* The total number of characters written. */
636 unsigned int total_size;
637};
638
639/* A simple output block. This can be used for simple IPA passes that
640 do not need more than one stream. */
642{
645
646 /* The stream that the main tree codes are written to. */
648};
649
650/* String hashing. */
651
653{
654 const char *s;
655 int len;
656 unsigned int slot_num;
657};
658
659/* Hashtable helpers. */
660
662{
663 static inline hashval_t hash (const string_slot *);
664 static inline bool equal (const string_slot *, const string_slot *);
665};
666
667/* Returns a hash code for DS. Adapted from libiberty's htab_hash_string
668 to support strings that may not end in '\0'. */
669
670inline hashval_t
672{
673 hashval_t r = ds->len;
674 int i;
675
676 for (i = 0; i < ds->len; i++)
677 r = r * 67 + (unsigned)ds->s[i] - 113;
678 return r;
679}
680
681/* Returns nonzero if DS1 and DS2 are equal. */
682
683inline bool
685{
686 if (ds1->len == ds2->len)
687 return memcmp (ds1->s, ds2->s, ds1->len) == 0;
688
689 return 0;
690}
691
692/* Data structure holding all the data and descriptors used when writing
693 an LTO file. */
695{
698
699 /* The stream that the main tree codes are written to. */
701
702 /* The stream that contains the string table. */
704
705 /* The stream that contains the cfg. */
707
708 /* The hash table that contains the set of strings we have seen so
709 far and the indexes assigned to them. */
711
712 /* The current symbol that we are currently serializing. Null
713 if we are serializing something else. */
715
716 /* These are the last file and line that were seen in the stream.
717 If the current node differs from these, it needs to insert
718 something into the stream and fix these up. */
719 const char *current_file;
727
728 /* Cache of nodes written in this section. */
730
731 /* All trees identified as local to the unit streamed. */
733
734 /* All data persistent across whole duration of output block
735 can go here. */
737};
738
739
740/* Data and descriptors used when reading from an LTO file. */
742{
743public:
744 /* The global decls and types. */
746
747 /* The string table. */
748 const char *strings;
749
750 /* The length of the string table. */
751 unsigned int strings_len;
752
753 /* Maps each reference number to the resolution done by the linker. */
755
756 /* Cache of pickled nodes. */
758
759 /* Cache of source code location. */
761};
762
763
764/* In lto-section-in.cc */
766 struct lto_file_decl_data *,
767 enum lto_section_type, const char **, size_t *);
768extern void
770 enum lto_section_type,
771 class lto_input_block *, const char *, size_t);
772extern void lto_set_in_hooks (struct lto_file_decl_data **,
775extern struct lto_file_decl_data **lto_get_file_decl_data (void);
776extern const char *lto_get_section_data (struct lto_file_decl_data *,
777 enum lto_section_type,
778 const char *, int, size_t *,
779 bool decompress = false);
780extern const char *lto_get_summary_section_data (struct lto_file_decl_data *,
781 enum lto_section_type,
782 size_t *);
783extern const char *lto_get_raw_section_data (struct lto_file_decl_data *,
784 enum lto_section_type,
785 const char *, int, size_t *);
786extern void lto_free_section_data (struct lto_file_decl_data *,
787 enum lto_section_type,
788 const char *, const char *, size_t,
789 bool decompress = false);
791 enum lto_section_type,
792 const char *, const char *, size_t);
793extern htab_t lto_create_renaming_table (void);
794extern void lto_record_renamed_decl (struct lto_file_decl_data *,
795 const char *, const char *);
796extern const char *lto_get_decl_name_mapping (struct lto_file_decl_data *,
797 const char *);
798extern struct lto_in_decl_state *lto_new_in_decl_state (void);
799extern void lto_delete_in_decl_state (struct lto_in_decl_state *);
801 struct lto_file_decl_data *, tree);
805extern void lto_value_range_error (const char *,
806 HOST_WIDE_INT, HOST_WIDE_INT,
807 HOST_WIDE_INT) ATTRIBUTE_NORETURN;
808
809/* In lto-section-out.cc */
810extern void lto_begin_section (const char *, bool);
811extern void lto_end_section (void);
812extern void lto_write_data (const void *, unsigned int);
813extern void lto_write_raw_data (const void *, unsigned int);
814extern void lto_write_stream (struct lto_output_stream *);
816 enum lto_section_type);
818extern struct lto_out_decl_state *lto_new_out_decl_state (void);
819extern void lto_delete_out_decl_state (struct lto_out_decl_state *);
820extern struct lto_out_decl_state *lto_get_out_decl_state (void);
821extern void lto_push_out_decl_state (struct lto_out_decl_state *);
822extern struct lto_out_decl_state *lto_pop_out_decl_state (void);
824 struct lto_out_decl_state *);
825extern void lto_append_block (struct lto_output_stream *);
826
827
828/* In lto-streamer.cc. */
829
830/* Set when streaming LTO for offloading compiler. */
831extern bool lto_stream_offload_p;
832
833extern const char *lto_tag_name (enum LTO_tags);
834extern char *lto_get_section_name (int, const char *, int,
835 struct lto_file_decl_data *);
836extern void print_lto_report (const char *);
837extern void lto_streamer_init (void);
838extern bool gate_lto_out (void);
839extern void lto_check_version (int, int, const char *);
840extern void lto_streamer_hooks_init (void);
841
842/* In lto-streamer-in.cc */
843extern void lto_input_cgraph (struct lto_file_decl_data *, const char *);
844extern void lto_reader_init (void);
845extern void lto_free_file_name_hash (void);
846extern void lto_input_function_body (struct lto_file_decl_data *,
847 struct cgraph_node *,
848 const char *);
850 struct varpool_node *,
851 const char *);
853 const char *);
854extern void lto_input_toplevel_asms (struct lto_file_decl_data *, int);
855extern void lto_input_mode_table (struct lto_file_decl_data *);
856extern class data_in *lto_data_in_create (struct lto_file_decl_data *,
857 const char *, unsigned,
859extern void lto_data_in_delete (class data_in *);
860extern void lto_input_data_block (class lto_input_block *, void *, size_t);
861void lto_input_location (location_t *, struct bitpack_d *, class data_in *);
863 struct function *, enum LTO_tags);
864void lto_tag_check_set (enum LTO_tags, int, ...);
865void lto_init_eh (void);
866hashval_t lto_input_scc (class lto_input_block *, class data_in *,
867 unsigned *, unsigned *, bool);
869 enum LTO_tags, hashval_t hash);
870tree lto_input_tree (class lto_input_block *, class data_in *);
872
873
874/* In lto-streamer-out.cc */
877extern void destroy_output_block (struct output_block *);
878extern void lto_output_tree (struct output_block *, tree, bool, bool);
879extern void stream_write_tree_ref (struct output_block *, tree);
880extern void lto_output_var_decl_ref (struct lto_out_decl_state *,
881 struct lto_output_stream *, tree);
882extern void lto_output_fn_decl_ref (struct lto_out_decl_state *,
883 struct lto_output_stream *, tree);
886extern void lto_output_toplevel_asms (void);
887extern void produce_asm (struct output_block *ob, tree fn);
888extern void lto_output ();
889extern void produce_asm_for_decls ();
891 struct lto_out_decl_state *);
893 struct lto_output_stream *,
894 struct lto_out_decl_state *);
895void lto_output_location (struct output_block *, struct bitpack_d *,
896 location_t);
898 location_t);
901
902
903/* In lto-cgraph.cc */
904extern bool asm_nodes_output;
910 struct cgraph_node *);
912 symtab_node *);
914 symtab_node *);
915
917 varpool_node *);
918void output_symtab (void);
919void input_symtab (void);
920void output_offload_tables (void);
921void input_offload_tables (bool);
931void select_what_to_stream (void);
932
933/* In omp-general.cc. */
938
939/* In options-save.cc. */
941 struct cl_target_option *);
942
944 struct bitpack_d *,
945 struct cl_target_option *);
946
948 struct bitpack_d *, struct cl_optimization *);
949
951 struct bitpack_d *, struct cl_optimization *);
952
953
954
955/* In lto-opts.cc. */
956extern void lto_write_options (void);
957
958
959/* Statistics gathered during LTO, WPA and LTRANS. */
960extern struct lto_stats_d lto_stats;
961
962/* Section names corresponding to the values of enum lto_section_type. */
963extern const char *lto_section_name[];
964
965/* Holds all the out decl states of functions output so far in the
966 current output file. */
968
969/* Return true if LTO tag TAG corresponds to a tree code. */
970inline bool
972{
973 return tag > LTO_first_tree_tag && (unsigned) tag <= MAX_TREE_CODES;
974}
975
976
977/* Return true if LTO tag TAG corresponds to a gimple code. */
978inline bool
980{
981 return (unsigned) tag >= LTO_first_gimple_tag
982 && (unsigned) tag
984}
985
986
987/* Return the LTO tag corresponding to gimple code CODE. See enum
988 LTO_tags for details on the conversion. */
989inline enum LTO_tags
991{
992 return (enum LTO_tags) ((unsigned) code + LTO_first_gimple_tag);
993}
994
995
996/* Return the GIMPLE code corresponding to TAG. See enum LTO_tags for
997 details on the conversion. */
998inline enum gimple_code
1000{
1002 return (enum gimple_code) ((unsigned) tag - LTO_first_gimple_tag);
1003}
1004
1005
1006/* Return the LTO tag corresponding to tree code CODE. See enum
1007 LTO_tags for details on the conversion. */
1008inline enum LTO_tags
1010{
1011 return (enum LTO_tags) ((unsigned) code + LTO_first_tree_tag);
1012}
1013
1014
1015/* Return the tree code corresponding to TAG. See enum LTO_tags for
1016 details on the conversion. */
1017inline enum tree_code
1019{
1021 return (enum tree_code) ((unsigned) tag - LTO_first_tree_tag);
1022}
1023
1024/* Check that tag ACTUAL == EXPECTED. */
1025inline void
1026lto_tag_check (enum LTO_tags actual, enum LTO_tags expected)
1027{
1028 if (actual != expected)
1029 internal_error ("bytecode stream: expected tag %s instead of %s",
1030 lto_tag_name (expected), lto_tag_name (actual));
1031}
1032
1033/* Check that tag ACTUAL is in the range [TAG1, TAG2]. */
1034inline void
1035lto_tag_check_range (enum LTO_tags actual, enum LTO_tags tag1,
1036 enum LTO_tags tag2)
1037{
1038 if (actual < tag1 || actual > tag2)
1039 internal_error ("bytecode stream: tag %s is not in the expected range "
1040 "[%s, %s]",
1041 lto_tag_name (actual),
1042 lto_tag_name (tag1),
1043 lto_tag_name (tag2));
1044}
1045
1046/* Initialize an lto_out_decl_buffer ENCODER. */
1047inline void
1049{
1050 encoder->tree_hash_table = new hash_map<tree, unsigned> (251);
1051 encoder->trees.create (0);
1052}
1053
1054
1055/* Destroy an lto_tree_ref_encoder ENCODER by freeing its contents. The
1056 memory used by ENCODER is not freed by this function. */
1057inline void
1059{
1060 /* Hash table may be delete already. */
1061 delete encoder->tree_hash_table;
1062 encoder->tree_hash_table = NULL;
1063 encoder->trees.release ();
1064}
1065
1066/* Return the number of trees encoded in ENCODER. */
1067inline unsigned int
1069{
1070 return encoder->trees.length ();
1071}
1072
1073/* Return the IDX-th tree in ENCODER. */
1074inline tree
1076 unsigned int idx)
1077{
1078 return encoder->trees[idx];
1079}
1080
1081/* Return number of encoded nodes in ENCODER. */
1082inline int
1084{
1085 return encoder->nodes.length ();
1086}
1087
1088/* Value used to represent failure of lto_symtab_encoder_lookup. */
1089#define LCC_NOT_FOUND (-1)
1090
1091/* Look up NODE in encoder. Return NODE's reference if it has been encoded
1092 or LCC_NOT_FOUND if it is not there. */
1093
1094inline int
1096 symtab_node *node)
1097{
1098 size_t *slot = encoder->map->get (node);
1099 return (slot && *slot ? *(slot) - 1 : LCC_NOT_FOUND);
1100}
1101
1102/* Return true if iterator LSE points to nothing. */
1103inline bool
1105{
1106 return lsei.index >= (unsigned)lto_symtab_encoder_size (lsei.encoder);
1107}
1108
1109/* Advance iterator LSE. */
1110inline void
1112{
1113 lsei->index++;
1114}
1115
1116/* Return the node pointed to by LSI. */
1117inline symtab_node *
1119{
1120 return lsei.encoder->nodes[lsei.index].node;
1121}
1122
1123/* Return the node pointed to by LSI. */
1124inline struct cgraph_node *
1129
1130/* Return the node pointed to by LSI. */
1131inline varpool_node *
1136
1137/* Return the cgraph node corresponding to REF using ENCODER. */
1138
1139inline symtab_node *
1141{
1142 if (ref == LCC_NOT_FOUND)
1143 return NULL;
1144
1145 return encoder->nodes[ref].node;
1146}
1147
1148/* Return an iterator to the first node in LSI. */
1151{
1153
1154 lsei.encoder = encoder;
1155 lsei.index = 0;
1156 return lsei;
1157}
1158
1159/* Advance iterator LSE. */
1160inline void
1162{
1163 lsei_next (lsei);
1164 while (!lsei_end_p (*lsei)
1166 lsei_next (lsei);
1167}
1168
1169/* Return an iterator to the first node in LSI. */
1172{
1173 lto_symtab_encoder_iterator lsei = lsei_start (encoder);
1174
1175 if (lsei_end_p (lsei))
1176 return lsei;
1177 if (!lto_symtab_encoder_in_partition_p (encoder, lsei_node (lsei)))
1178 lsei_next_in_partition (&lsei);
1179
1180 return lsei;
1181}
1182
1183/* Advance iterator LSE. */
1184inline void
1186{
1187 lsei_next (lsei);
1188 while (!lsei_end_p (*lsei)
1189 && (!is_a <cgraph_node *> (lsei_node (*lsei))
1191 lsei_next (lsei);
1192}
1193
1194/* Return an iterator to the first node in LSI. */
1197{
1198 lto_symtab_encoder_iterator lsei = lsei_start (encoder);
1199
1200 if (lsei_end_p (lsei))
1201 return lsei;
1202 if (!is_a <cgraph_node *> (lsei_node (lsei))
1203 || !lto_symtab_encoder_in_partition_p (encoder, lsei_node (lsei)))
1205
1206 return lsei;
1207}
1208
1209/* Advance iterator LSE. */
1210inline void
1212{
1213 lsei_next (lsei);
1214 while (!lsei_end_p (*lsei)
1215 && (!is_a <varpool_node *> (lsei_node (*lsei))
1217 lsei_next (lsei);
1218}
1219
1220/* Return an iterator to the first node in LSI. */
1223{
1224 lto_symtab_encoder_iterator lsei = lsei_start (encoder);
1225
1226 if (lsei_end_p (lsei))
1227 return lsei;
1228 if (!is_a <varpool_node *> (lsei_node (lsei))
1229 || !lto_symtab_encoder_in_partition_p (encoder, lsei_node (lsei)))
1231
1232 return lsei;
1233}
1234
1235/* Entry for the delayed registering of decl -> DIE references. */
1238 const char *sym;
1239 unsigned HOST_WIDE_INT off;
1240};
1241
1243
1244extern FILE *streamer_dump_file;
1245
1246#endif /* GCC_LTO_STREAMER_H */
Definition vec.h:1656
Definition lto-streamer.h:742
vec< ld_plugin_symbol_resolution_t > globals_resolution
Definition lto-streamer.h:754
lto_location_cache location_cache
Definition lto-streamer.h:760
struct streamer_tree_cache_d * reader_cache
Definition lto-streamer.h:757
unsigned int strings_len
Definition lto-streamer.h:751
struct lto_file_decl_data * file_data
Definition lto-streamer.h:745
const char * strings
Definition lto-streamer.h:748
Definition genoutput.cc:147
Definition hash-map.h:40
Value * get(const Key &k)
Definition hash-map.h:189
Definition hash-set.h:37
Definition hash-table.h:375
Definition lto-streamer.h:338
unsigned int len
Definition lto-streamer.h:352
unsigned int p
Definition lto-streamer.h:351
lto_input_block(const char *data_, unsigned int p_, unsigned int len_, const lto_file_decl_data *file_data_)
Definition lto-streamer.h:342
const char * data
Definition lto-streamer.h:349
const lto_file_decl_data * file_data
Definition lto-streamer.h:350
lto_input_block(const char *data_, unsigned int len_, const lto_file_decl_data *file_data_)
Definition lto-streamer.h:345
Definition lto-streamer.h:266
void revert_location_cache()
Definition lto-streamer-in.cc:503
static int cmp_loc(const void *pa, const void *pb)
Definition lto-streamer-in.cc:386
lto_location_cache()
Definition lto-streamer.h:280
auto_vec< cached_location > loc_cache
Definition lto-streamer.h:315
void accept_location_cache()
Definition lto-streamer-in.cc:494
int accepted_length
Definition lto-streamer.h:320
void input_location_and_block(location_t *loc, struct bitpack_d *bp, class lto_input_block *ib, class data_in *data_in)
Definition lto-streamer-in.cc:514
~lto_location_cache()
Definition lto-streamer.h:288
tree current_block
Definition lto-streamer.h:332
const char * current_file
Definition lto-streamer.h:327
unsigned current_discr
Definition lto-streamer.h:333
int current_col
Definition lto-streamer.h:329
int current_line
Definition lto-streamer.h:328
bool apply_location_cache()
Definition lto-streamer-in.cc:430
location_t current_loc
Definition lto-streamer.h:331
static lto_location_cache * current_cache
Definition lto-streamer.h:298
bool current_sysp
Definition lto-streamer.h:330
Definition lra-spills.cc:101
#define GTY(x)
Definition coretypes.h:41
union tree_node * tree
Definition coretypes.h:97
void internal_error(const char *,...) ATTRIBUTE_GCC_DIAG(1
void ATTRIBUTE_NORETURN
Definition diagnostic-core.h:72
tree_code
Definition genmatch.cc:347
@ MAX_TREE_CODES
Definition genmatch.cc:349
gimple_code
Definition gimple.h:30
@ LAST_AND_UNUSED_GIMPLE_CODE
Definition gimple.h:34
location_t input_location
Definition input.cc:190
#define UNKNOWN_LOCATION
Definition input.h:32
bool is_a(U *p)
Definition is-a.h:230
T dyn_cast(U *p)
Definition is-a.h:280
void lto_section_overrun(class lto_input_block *) ATTRIBUTE_NORETURN
Definition lto-section-in.cc:458
void lto_input_variable_constructor(struct lto_file_decl_data *, struct varpool_node *, const char *)
Definition lto-streamer-in.cc:1701
void lto_output_init_mode_table(void)
Definition lto-streamer-out.cc:3181
struct lto_out_decl_state * lto_get_out_decl_state(void)
Definition lto-section-out.cc:232
void lto_free_function_in_decl_state(struct lto_in_decl_state *)
Definition lto-section-in.cc:423
tree lto_input_tree(class lto_input_block *, class data_in *)
Definition lto-streamer-in.cc:1925
void lto_free_file_name_hash(void)
Definition lto-streamer-in.cc:2154
void lto_record_function_out_decl_state(tree, struct lto_out_decl_state *)
Definition lto-section-out.cc:258
void lsei_next(lto_symtab_encoder_iterator *lsei)
Definition lto-streamer.h:1111
void cl_optimization_stream_out(struct output_block *, struct bitpack_d *, struct cl_optimization *)
struct lto_symtab_encoder_d * lto_symtab_encoder_t
Definition lto-streamer.h:466
struct lto_out_decl_state * lto_out_decl_state_ptr
Definition lto-streamer.h:536
lto_symtab_encoder_iterator lsei_start_in_partition(lto_symtab_encoder_t encoder)
Definition lto-streamer.h:1171
struct lto_in_decl_state * lto_get_function_in_decl_state(struct lto_file_decl_data *, tree)
Definition lto-section-in.cc:409
vec< lto_out_decl_state_ptr > lto_function_decl_states
Definition lto-section-out.cc:40
class data_in * lto_data_in_create(struct lto_file_decl_data *, const char *, unsigned, vec< ld_plugin_symbol_resolution_t >)
Definition lto-streamer-in.cc:2174
lto_symtab_encoder_t compute_ltrans_boundary(lto_symtab_encoder_t encoder)
Definition lto-cgraph.cc:840
void lto_input_cgraph(struct lto_file_decl_data *, const char *)
void lto_write_raw_data(const void *, unsigned int)
Definition lto-section-out.cc:112
char * lto_get_section_name(int, const char *, int, struct lto_file_decl_data *)
Definition lto-streamer.cc:103
htab_t lto_create_renaming_table(void)
Definition lto-section-in.cc:332
const char * lto_get_summary_section_data(struct lto_file_decl_data *, enum lto_section_type, size_t *)
Definition lto-section-in.cc:184
void print_lto_report(const char *)
Definition lto-streamer.cc:159
void lto_free_function_in_decl_state_for_node(symtab_node *)
Definition lto-section-in.cc:435
enum tree_code lto_tag_to_tree_code(enum LTO_tags tag)
Definition lto-streamer.h:1018
lto_symtab_encoder_iterator lsei_start_variable_in_partition(lto_symtab_encoder_t encoder)
Definition lto-streamer.h:1222
void lto_output_tree(struct output_block *, tree, bool, bool)
Definition lto-streamer-out.cc:1795
void lto_destroy_simple_output_block(struct lto_simple_output_block *)
Definition lto-section-out.cc:171
tree lto_input_tree_1(class lto_input_block *, class data_in *, enum LTO_tags, hashval_t hash)
Definition lto-streamer-in.cc:1871
bool referenced_from_this_partition_p(symtab_node *, lto_symtab_encoder_t)
Definition lto-cgraph.cc:351
void stream_write_tree_ref(struct output_block *, tree)
Definition lto-streamer-out.cc:467
struct lto_file_decl_data * lto_file_decl_data_ptr
Definition lto-streamer.h:607
const char * lto_get_decl_name_mapping(struct lto_file_decl_data *, const char *)
Definition lto-section-in.cc:366
void cl_optimization_stream_in(class data_in *, struct bitpack_d *, struct cl_optimization *)
void lsei_next_function_in_partition(lto_symtab_encoder_iterator *lsei)
Definition lto-streamer.h:1185
bool lto_symtab_encoder_encode_body_p(lto_symtab_encoder_t, struct cgraph_node *)
Definition lto-cgraph.cc:173
void lto_free_section_data_f(struct lto_file_decl_data *, enum lto_section_type, const char *, const char *, size_t)
Definition lto-streamer.h:255
void lto_tag_check(enum LTO_tags actual, enum LTO_tags expected)
Definition lto-streamer.h:1026
struct lto_in_decl_state * lto_in_decl_state_ptr
Definition lto-streamer.h:500
tree lto_tree_ref_encoder_get_tree(struct lto_tree_ref_encoder *encoder, unsigned int idx)
Definition lto-streamer.h:1075
struct lto_out_decl_state * lto_new_out_decl_state(void)
Definition lto-section-out.cc:200
lto_symtab_encoder_iterator lsei_start_function_in_partition(lto_symtab_encoder_t encoder)
Definition lto-streamer.h:1196
enum gimple_code lto_tag_to_gimple_code(enum LTO_tags tag)
Definition lto-streamer.h:999
LTO_tags
Definition lto-streamer.h:134
@ LTO_ert_allowed_exceptions
Definition lto-streamer.h:183
@ LTO_tree_scc
Definition lto-streamer.h:152
@ LTO_ert_try
Definition lto-streamer.h:182
@ LTO_bb1
Definition lto-streamer.h:169
@ LTO_eh_catch
Definition lto-streamer.h:190
@ LTO_NUM_TAGS
Definition lto-streamer.h:193
@ LTO_global_stream_ref
Definition lto-streamer.h:147
@ LTO_ert_must_not_throw
Definition lto-streamer.h:184
@ LTO_tree_pickle_reference
Definition lto-streamer.h:138
@ LTO_null
Definition lto-streamer.h:135
@ LTO_bb0
Definition lto-streamer.h:168
@ LTO_eh_region
Definition lto-streamer.h:172
@ LTO_ssa_name_ref
Definition lto-streamer.h:149
@ LTO_trees
Definition lto-streamer.h:155
@ LTO_first_tree_tag
Definition lto-streamer.h:162
@ LTO_function
Definition lto-streamer.h:175
@ LTO_first_gimple_tag
Definition lto-streamer.h:165
@ LTO_eh_landing_pad
Definition lto-streamer.h:187
@ LTO_integer_cst
Definition lto-streamer.h:158
@ LTO_eh_table
Definition lto-streamer.h:178
@ LTO_ert_cleanup
Definition lto-streamer.h:181
void lto_output_location_and_block(struct output_block *, struct bitpack_d *, location_t)
Definition lto-streamer-out.cc:284
void lto_output_toplevel_asms(void)
Definition lto-streamer-out.cc:2524
int lto_symtab_encoder_lookup(lto_symtab_encoder_t encoder, symtab_node *node)
Definition lto-streamer.h:1095
enum ld_plugin_symbol_resolution ld_plugin_symbol_resolution_t
Definition lto-streamer.h:238
bool lsei_end_p(lto_symtab_encoder_iterator lsei)
Definition lto-streamer.h:1104
void lto_begin_section(const char *, bool)
Definition lto-section-out.cc:66
void lto_input_data_block(class lto_input_block *, void *, size_t)
Definition lto-streamer-in.cc:132
bool referenced_from_other_partition_p(struct ipa_ref_list *, lto_symtab_encoder_t)
void lto_write_data(const void *, unsigned int)
Definition lto-section-out.cc:101
void output_symtab(void)
Definition lto-cgraph.cc:971
void lto_streamer_hooks_init(void)
Definition lto-streamer.cc:279
struct output_block * create_output_block(enum lto_section_type)
Definition lto-streamer-out.cc:78
void lto_delete_in_decl_state(struct lto_in_decl_state *)
Definition lto-section-in.cc:396
void cl_target_option_stream_out(struct output_block *, struct bitpack_d *, struct cl_target_option *)
void lto_input_mode_table(struct lto_file_decl_data *)
Definition lto-streamer-in.cc:1996
void lsei_next_in_partition(lto_symtab_encoder_iterator *lsei)
Definition lto-streamer.h:1161
lto_decl_stream_e_t
Definition lto-streamer.h:233
@ LTO_N_DECL_STREAMS
Definition lto-streamer.h:235
@ LTO_DECL_STREAM
Definition lto-streamer.h:234
lto_section_type
Definition lto-streamer.h:204
@ LTO_section_offload_table
Definition lto-streamer.h:222
@ LTO_section_symtab
Definition lto-streamer.h:208
@ LTO_section_decls
Definition lto-streamer.h:205
@ LTO_section_cgraph_opt_sum
Definition lto-streamer.h:218
@ LTO_section_jump_functions
Definition lto-streamer.h:212
@ LTO_section_ipa_modref
Definition lto-streamer.h:227
@ LTO_section_ipa_fn_summary
Definition lto-streamer.h:219
@ LTO_section_ipcp_transform
Definition lto-streamer.h:220
@ LTO_section_ipa_pure_const
Definition lto-streamer.h:213
@ LTO_section_lto
Definition lto-streamer.h:224
@ LTO_section_symtab_extension
Definition lto-streamer.h:209
@ LTO_section_symtab_nodes
Definition lto-streamer.h:216
@ LTO_section_ipa_sra
Definition lto-streamer.h:225
@ LTO_section_ipa_profile
Definition lto-streamer.h:215
@ LTO_section_static_initializer
Definition lto-streamer.h:207
@ LTO_section_odr_types
Definition lto-streamer.h:226
@ LTO_section_refs
Definition lto-streamer.h:210
@ LTO_section_opts
Definition lto-streamer.h:217
@ LTO_section_mode_table
Definition lto-streamer.h:223
@ LTO_section_asm
Definition lto-streamer.h:211
@ LTO_section_ipa_reference
Definition lto-streamer.h:214
@ LTO_N_SECTION_TYPES
Definition lto-streamer.h:228
@ LTO_section_function_body
Definition lto-streamer.h:206
@ LTO_section_ipa_icf
Definition lto-streamer.h:221
symtab_node * lsei_node(lto_symtab_encoder_iterator lsei)
Definition lto-streamer.h:1118
lto_symtab_encoder_iterator lsei_start(lto_symtab_encoder_t encoder)
Definition lto-streamer.h:1150
void lto_value_range_error(const char *, HOST_WIDE_INT, HOST_WIDE_INT, HOST_WIDE_INT) ATTRIBUTE_NORETURN
Definition lto-section-in.cc:467
const char * lto_get_section_data(struct lto_file_decl_data *, enum lto_section_type, const char *, int, size_t *, bool decompress=false)
Definition lto-section-in.cc:134
int lto_symtab_encoder_size(lto_symtab_encoder_t encoder)
Definition lto-streamer.h:1083
void lto_input_constructors_and_inits(struct lto_file_decl_data *, const char *)
tree lto_input_var_decl_ref(lto_input_block *, lto_file_decl_data *)
Definition lto-streamer-in.cc:669
void lto_destroy_simple_input_block(struct lto_file_decl_data *, enum lto_section_type, class lto_input_block *, const char *, size_t)
Definition lto-section-in.cc:276
void lto_init_tree_ref_encoder(struct lto_tree_ref_encoder *encoder)
Definition lto-streamer.h:1048
tree lto_input_fn_decl_ref(lto_input_block *, lto_file_decl_data *)
Definition lto-streamer-in.cc:681
void lto_output_decl_state_streams(struct output_block *, struct lto_out_decl_state *)
Definition lto-streamer-out.cc:2908
void lto_check_version(int, int, const char *)
Definition lto-streamer.cc:264
void produce_asm(struct output_block *ob, tree fn)
Definition lto-streamer-out.cc:2207
void lto_output_fn_decl_ref(struct lto_out_decl_state *, struct lto_output_stream *, tree)
Definition lto-streamer-out.cc:359
struct lto_file_decl_data ** lto_get_file_decl_data(void)
Definition lto-section-in.cc:89
void lto_delete_out_decl_state(struct lto_out_decl_state *)
Definition lto-section-out.cc:218
void lto_data_in_delete(class data_in *)
Definition lto-streamer-in.cc:2191
void lto_symtab_encoder_delete(lto_symtab_encoder_t)
Definition lto-cgraph.cc:94
bool lto_tag_is_gimple_code_p(enum LTO_tags tag)
Definition lto-streamer.h:979
void lto_output_var_decl_ref(struct lto_out_decl_state *, struct lto_output_stream *, tree)
Definition lto-streamer-out.cc:346
int lto_symtab_encoder_encode(lto_symtab_encoder_t, symtab_node *)
Definition lto-cgraph.cc:108
void destroy_output_block(struct output_block *)
Definition lto-streamer-out.cc:110
FILE * streamer_dump_file
Definition lto-streamer.cc:42
bool lto_tag_is_tree_code_p(enum LTO_tags tag)
Definition lto-streamer.h:971
lto_symtab_encoder_t lto_symtab_encoder_new(bool)
Definition lto-cgraph.cc:80
struct lto_simple_output_block * lto_create_simple_output_block(enum lto_section_type)
Definition lto-section-out.cc:153
void lto_reader_init(void)
Definition lto-streamer-in.cc:2141
void lto_tag_check_range(enum LTO_tags actual, enum LTO_tags tag1, enum LTO_tags tag2)
Definition lto-streamer.h:1035
enum LTO_tags lto_tree_code_to_tag(enum tree_code code)
Definition lto-streamer.h:1009
void input_symtab(void)
Definition lto-cgraph.cc:1758
struct lto_stats_d lto_stats
Definition lto-streamer.cc:36
void select_what_to_stream(void)
Definition lto-cgraph.cc:824
unsigned int lto_tree_ref_encoder_size(struct lto_tree_ref_encoder *encoder)
Definition lto-streamer.h:1068
void lsei_next_variable_in_partition(lto_symtab_encoder_iterator *lsei)
Definition lto-streamer.h:1211
void produce_asm_for_decls()
Definition lto-streamer-out.cc:3277
void lto_free_raw_section_data(struct lto_file_decl_data *, enum lto_section_type, const char *, const char *, size_t)
Definition lto-section-in.cc:234
void omp_lto_input_declare_variant_alt(lto_input_block *, cgraph_node *, vec< symtab_node * >)
Definition omp-general.cc:2821
enum LTO_tags lto_gimple_code_to_tag(enum gimple_code code)
Definition lto-streamer.h:990
void output_offload_tables(void)
Definition lto-cgraph.cc:1080
void lto_input_toplevel_asms(struct lto_file_decl_data *, int)
Definition lto-streamer-in.cc:1957
bool asm_nodes_output
Definition lto-cgraph.cc:49
tree lto_input_tree_ref(class lto_input_block *, class data_in *, struct function *, enum LTO_tags)
Definition lto-streamer-in.cc:642
void lto_output()
Definition lto-streamer-out.cc:2728
void lto_append_block(struct lto_output_stream *)
Definition data-streamer-out.cc:38
void omp_lto_output_declare_variant_alt(lto_simple_output_block *, cgraph_node *, lto_symtab_encoder_t)
Definition omp-general.cc:2759
void lto_write_options(void)
Definition lto-opts.cc:60
tree stream_read_tree_ref(class lto_input_block *, class data_in *)
Definition lto-streamer-in.cc:1845
void lto_set_symtab_encoder_in_partition(lto_symtab_encoder_t, symtab_node *)
Definition lto-cgraph.cc:228
void lto_push_out_decl_state(struct lto_out_decl_state *)
Definition lto-section-out.cc:240
lto_compression
Definition lto-streamer.h:358
@ ZSTD
Definition lto-streamer.h:360
@ ZLIB
Definition lto-streamer.h:359
void cl_target_option_stream_in(class data_in *, struct bitpack_d *, struct cl_target_option *)
void lto_input_function_body(struct lto_file_decl_data *, struct cgraph_node *, const char *)
Definition lto-streamer-in.cc:1691
class lto_input_block * lto_create_simple_input_block(struct lto_file_decl_data *, enum lto_section_type, const char **, size_t *)
Definition lto-section-in.cc:249
void lto_input_location(location_t *, struct bitpack_d *, class data_in *)
Definition lto-streamer-in.cc:628
symtab_node * lto_symtab_encoder_deref(lto_symtab_encoder_t encoder, int ref)
Definition lto-streamer.h:1140
varpool_node * lsei_varpool_node(lto_symtab_encoder_iterator lsei)
Definition lto-streamer.h:1132
bool lto_stream_offload_p
Definition lto-streamer.cc:40
void lto_write_stream(struct lto_output_stream *)
Definition lto-section-out.cc:121
struct lto_out_decl_state * lto_pop_out_decl_state(void)
Definition lto-section-out.cc:248
bool lto_symtab_encoder_delete_node(lto_symtab_encoder_t, symtab_node *)
Definition lto-cgraph.cc:140
#define LCC_NOT_FOUND
Definition lto-streamer.h:1089
void lto_destroy_tree_ref_encoder(struct lto_tree_ref_encoder *encoder)
Definition lto-streamer.h:1058
void lto_register_decl_definition(tree, struct lto_file_decl_data *)
const char * lto_tag_name(enum LTO_tags)
Definition lto-streamer.cc:47
struct cgraph_node * lsei_cgraph_node(lto_symtab_encoder_iterator lsei)
Definition lto-streamer.h:1125
void lto_streamer_init(void)
Definition lto-streamer.cc:240
void input_offload_tables(bool)
Definition lto-cgraph.cc:1830
void lto_init_eh(void)
Definition lto-streamer-in.cc:897
void lto_output_location(struct output_block *, struct bitpack_d *, location_t)
Definition lto-streamer-out.cc:272
void lto_prepare_function_for_streaming(cgraph_node *)
Definition lto-streamer-out.cc:2323
bool gate_lto_out(void)
Definition lto-streamer.cc:254
bool reachable_from_other_partition_p(struct cgraph_node *, lto_symtab_encoder_t)
Definition lto-cgraph.cc:327
void lto_record_renamed_decl(struct lto_file_decl_data *, const char *, const char *)
Definition lto-section-in.cc:341
bool reachable_from_this_partition_p(struct cgraph_node *, lto_symtab_encoder_t)
Definition lto-cgraph.cc:366
unsigned char lto_decl_flags_t
Definition lto-streamer.h:127
struct lto_in_decl_state * lto_new_in_decl_state(void)
Definition lto-section-in.cc:388
void lto_end_section(void)
Definition lto-section-out.cc:88
vec< dref_entry > dref_queue
Definition lto-streamer-in.cc:1710
bool lto_symtab_encoder_in_partition_p(lto_symtab_encoder_t, symtab_node *)
Definition lto-cgraph.cc:216
void lto_tag_check_set(enum LTO_tags, int,...)
Definition lto-streamer-in.cc:111
void lto_set_in_hooks(struct lto_file_decl_data **, lto_get_section_data_f *, lto_free_section_data_f *)
Definition lto-section-in.cc:75
hashval_t lto_input_scc(class lto_input_block *, class data_in *, unsigned *, unsigned *, bool)
Definition lto-streamer-in.cc:1784
const char * lto_get_section_data_f(struct lto_file_decl_data *, enum lto_section_type, const char *, int, size_t *)
Definition lto-streamer.h:246
const char * lto_section_name[]
Definition lto-section-in.cc:35
const char * lto_get_raw_section_data(struct lto_file_decl_data *, enum lto_section_type, const char *, int, size_t *)
Definition lto-section-in.cc:193
bool lto_symtab_encoder_encode_initializer_p(lto_symtab_encoder_t, varpool_node *)
Definition lto-cgraph.cc:194
void lto_free_section_data(struct lto_file_decl_data *, enum lto_section_type, const char *, const char *, size_t, bool decompress=false)
Definition lto-section-in.cc:206
void lto_output_decl_state_refs(struct output_block *, struct lto_output_stream *, struct lto_out_decl_state *)
poly_int< N, C > r
Definition poly-int.h:770
i
Definition poly-int.h:772
Ca const poly_int< N, Cb > & b
Definition poly-int.h:767
Ca & a
Definition poly-int.h:766
Definition data-streamer.h:35
Definition cgraph.h:875
Definition lto-streamer.h:503
static bool equal(lto_in_decl_state *a, lto_in_decl_state *b)
Definition lto-streamer.h:511
static hashval_t hash(lto_in_decl_state *s)
Definition lto-streamer.h:505
Definition lto-streamer.h:1236
tree decl
Definition lto-streamer.h:1237
unsigned HOST_WIDE_INT off
Definition lto-streamer.h:1239
const char * sym
Definition lto-streamer.h:1238
Definition function.h:249
Definition gcov-io.h:346
Definition hash-traits.h:321
Definition ipa-ref.h:75
Definition lto-streamer.h:610
char * ptr
Definition lto-streamer.h:611
Definition lto-streamer.h:415
int32_t decl_state_size
Definition lto-streamer.h:417
int32_t num_nodes
Definition lto-streamer.h:420
Definition lto-streamer.h:445
unsigned int body
Definition lto-streamer.h:451
unsigned int in_partition
Definition lto-streamer.h:449
unsigned int initializer
Definition lto-streamer.h:455
symtab_node * node
Definition lto-streamer.h:446
Definition lto-streamer.h:553
htab_t section_hash_table
Definition lto-streamer.h:571
unsigned mode_bits
Definition lto-streamer.h:604
unsigned max_index
Definition lto-streamer.h:587
vec< res_pair > respairs
Definition lto-streamer.h:586
struct lto_file_decl_data * next
Definition lto-streamer.h:577
struct lto_in_decl_state * global_decl_state
Definition lto-streamer.h:559
gcov_summary profile_info
Definition lto-streamer.h:589
int order
Definition lto-streamer.h:580
htab_t renaming_hash_table
Definition lto-streamer.h:574
unsigned HOST_WIDE_INT id
Definition lto-streamer.h:583
const char * file_name
Definition lto-streamer.h:568
lto_section lto_section_header
Definition lto-streamer.h:598
int order_base
Definition lto-streamer.h:600
const unsigned char * mode_table
Definition lto-streamer.h:595
hash_map< tree, ld_plugin_symbol_resolution > * resolution_map
Definition lto-streamer.h:592
int unit_base
Definition lto-streamer.h:602
struct lto_in_decl_state * current_decl_state
Definition lto-streamer.h:555
hash_table< decl_state_hasher > * function_decl_states
Definition lto-streamer.h:565
lto_symtab_encoder_t symtab_node_encoder
Definition lto-streamer.h:562
Definition lto-streamer.h:407
int32_t cfg_size
Definition lto-streamer.h:409
Definition lto-streamer.h:488
bool compressed
Definition lto-streamer.h:497
tree fn_decl
Definition lto-streamer.h:494
vec< tree, va_gc > * streams[LTO_N_DECL_STREAMS]
Definition lto-streamer.h:490
Definition lto-streamer.h:304
tree block
Definition lto-streamer.h:309
const char * file
Definition lto-streamer.h:305
unsigned discr
Definition lto-streamer.h:310
int line
Definition lto-streamer.h:307
location_t * loc
Definition lto-streamer.h:306
int col
Definition lto-streamer.h:307
bool sysp
Definition lto-streamer.h:308
Definition lto-streamer.h:520
lto_symtab_encoder_t symtab_node_encoder
Definition lto-streamer.h:526
bool compressed
Definition lto-streamer.h:533
tree fn_decl
Definition lto-streamer.h:530
struct lto_tree_ref_encoder streams[LTO_N_DECL_STREAMS]
Definition lto-streamer.h:523
Definition lto-streamer.h:619
struct lto_char_ptr_base * current_block
Definition lto-streamer.h:624
unsigned int total_size
Definition lto-streamer.h:636
unsigned int block_size
Definition lto-streamer.h:633
unsigned int left_in_block
Definition lto-streamer.h:630
char * current_pointer
Definition lto-streamer.h:627
struct lto_char_ptr_base * first_block
Definition lto-streamer.h:621
Definition lto-streamer.h:367
uint16_t flags
Definition lto-streamer.h:374
unsigned char _padding
Definition lto-streamer.h:371
int16_t minor_version
Definition lto-streamer.h:369
unsigned char slim_object
Definition lto-streamer.h:370
int16_t major_version
Definition lto-streamer.h:368
lto_compression get_compression()
Definition lto-streamer.h:383
void set_compression(lto_compression c)
Definition lto-streamer.h:377
Definition lto-streamer.h:400
int32_t string_size
Definition lto-streamer.h:402
Definition lto-streamer.h:394
int32_t main_size
Definition lto-streamer.h:396
Definition lto-streamer.h:642
struct lto_output_stream * main_stream
Definition lto-streamer.h:647
enum lto_section_type section_type
Definition lto-streamer.h:643
struct lto_out_decl_state * decl_state
Definition lto-streamer.h:644
Definition lto-streamer.h:426
unsigned HOST_WIDE_INT num_pickle_refs_output
Definition lto-streamer.h:440
unsigned HOST_WIDE_INT num_input_cgraph_nodes
Definition lto-streamer.h:427
unsigned HOST_WIDE_INT num_output_il_bytes
Definition lto-streamer.h:435
unsigned HOST_WIDE_INT num_input_files
Definition lto-streamer.h:429
unsigned HOST_WIDE_INT num_compressed_il_bytes
Definition lto-streamer.h:436
unsigned HOST_WIDE_INT num_output_files
Definition lto-streamer.h:430
unsigned HOST_WIDE_INT num_trees[NUM_TREE_CODES]
Definition lto-streamer.h:434
unsigned HOST_WIDE_INT num_function_bodies
Definition lto-streamer.h:433
unsigned HOST_WIDE_INT num_input_il_bytes
Definition lto-streamer.h:437
unsigned HOST_WIDE_INT section_size[LTO_N_SECTION_TYPES]
Definition lto-streamer.h:432
unsigned HOST_WIDE_INT num_uncompressed_il_bytes
Definition lto-streamer.h:438
unsigned HOST_WIDE_INT num_cgraph_partitions
Definition lto-streamer.h:431
unsigned HOST_WIDE_INT num_output_symtab_nodes
Definition lto-streamer.h:428
unsigned HOST_WIDE_INT num_tree_bodies_output
Definition lto-streamer.h:439
Definition lto-streamer.h:461
vec< lto_encoder_entry > nodes
Definition lto-streamer.h:462
hash_map< symtab_node *, size_t > * map
Definition lto-streamer.h:463
Definition lto-streamer.h:470
lto_symtab_encoder_t encoder
Definition lto-streamer.h:471
unsigned index
Definition lto-streamer.h:472
Definition lto-streamer.h:480
hash_map< tree, unsigned > * tree_hash_table
Definition lto-streamer.h:481
vec< tree > trees
Definition lto-streamer.h:482
Definition hash-traits.h:303
Definition lto-streamer.h:695
unsigned current_discr
Definition lto-streamer.h:726
struct obstack obstack
Definition lto-streamer.h:736
int current_line
Definition lto-streamer.h:720
struct lto_output_stream * cfg_stream
Definition lto-streamer.h:706
struct lto_output_stream * string_stream
Definition lto-streamer.h:703
enum lto_section_type section_type
Definition lto-streamer.h:696
hash_set< tree > * local_trees
Definition lto-streamer.h:732
bool current_sysp
Definition lto-streamer.h:722
int current_col
Definition lto-streamer.h:721
tree current_block
Definition lto-streamer.h:725
struct lto_out_decl_state * decl_state
Definition lto-streamer.h:697
bool emit_pwd
Definition lto-streamer.h:724
hash_table< string_slot_hasher > * string_hash_table
Definition lto-streamer.h:710
symtab_node * symbol
Definition lto-streamer.h:714
const char * current_file
Definition lto-streamer.h:719
bool reset_locus
Definition lto-streamer.h:723
struct streamer_tree_cache_d * writer_cache
Definition lto-streamer.h:729
struct lto_output_stream * main_stream
Definition lto-streamer.h:700
Definition lto-streamer.h:542
ld_plugin_symbol_resolution_t res
Definition lto-streamer.h:543
unsigned index
Definition lto-streamer.h:544
Definition tree-streamer.h:47
Definition lto-streamer.h:662
static bool equal(const string_slot *, const string_slot *)
Definition lto-streamer.h:684
static hashval_t hash(const string_slot *)
Definition lto-streamer.h:671
Definition lto-streamer.h:653
int len
Definition lto-streamer.h:655
unsigned int slot_num
Definition lto-streamer.h:656
const char * s
Definition lto-streamer.h:654
Definition cgraph.h:106
Definition cgraph.h:2000
Definition vec.h:450
#define NULL
Definition system.h:50
#define gcc_assert(EXPR)
Definition system.h:821
#define false
Definition system.h:895
#define STATIC_ASSERT(X)
Definition system.h:871
#define NUM_TREE_CODES
Definition tree-core.h:156
#define NULL_TREE
Definition tree.h:317