annotate gcc/lto-streamer.h @ 131:84e7813d76e9

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