annotate gcc/tree-streamer-in.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Routines for reading trees from a file stream.
kono
parents:
diff changeset
2
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3 Copyright (C) 2011-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
4 Contributed by Diego Novillo <dnovillo@google.com>
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 This file is part of GCC.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
9 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
10 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
11 version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
16 for more details.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 #include "config.h"
kono
parents:
diff changeset
23 #include "system.h"
kono
parents:
diff changeset
24 #include "coretypes.h"
kono
parents:
diff changeset
25 #include "backend.h"
kono
parents:
diff changeset
26 #include "target.h"
kono
parents:
diff changeset
27 #include "tree.h"
kono
parents:
diff changeset
28 #include "gimple.h"
kono
parents:
diff changeset
29 #include "stringpool.h"
kono
parents:
diff changeset
30 #include "tree-streamer.h"
kono
parents:
diff changeset
31 #include "cgraph.h"
kono
parents:
diff changeset
32 #include "builtins.h"
kono
parents:
diff changeset
33 #include "gomp-constants.h"
kono
parents:
diff changeset
34 #include "stringpool.h"
kono
parents:
diff changeset
35 #include "attribs.h"
kono
parents:
diff changeset
36 #include "asan.h"
kono
parents:
diff changeset
37 #include "opts.h"
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39
kono
parents:
diff changeset
40 /* Read a STRING_CST from the string table in DATA_IN using input
kono
parents:
diff changeset
41 block IB. */
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 tree
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
44 streamer_read_string_cst (class data_in *data_in, class lto_input_block *ib)
111
kono
parents:
diff changeset
45 {
kono
parents:
diff changeset
46 unsigned int len;
kono
parents:
diff changeset
47 const char * ptr;
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 ptr = streamer_read_indexed_string (data_in, ib, &len);
kono
parents:
diff changeset
50 if (!ptr)
kono
parents:
diff changeset
51 return NULL;
kono
parents:
diff changeset
52 return build_string (len, ptr);
kono
parents:
diff changeset
53 }
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55
kono
parents:
diff changeset
56 /* Read an IDENTIFIER from the string table in DATA_IN using input
kono
parents:
diff changeset
57 block IB. */
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 static tree
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
60 input_identifier (class data_in *data_in, class lto_input_block *ib)
111
kono
parents:
diff changeset
61 {
kono
parents:
diff changeset
62 unsigned int len;
kono
parents:
diff changeset
63 const char *ptr;
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 ptr = streamer_read_indexed_string (data_in, ib, &len);
kono
parents:
diff changeset
66 if (!ptr)
kono
parents:
diff changeset
67 return NULL;
kono
parents:
diff changeset
68 return get_identifier_with_length (ptr, len);
kono
parents:
diff changeset
69 }
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 /* Read a chain of tree nodes from input block IB. DATA_IN contains
kono
parents:
diff changeset
73 tables and descriptors for the file being read. */
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 tree
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
76 streamer_read_chain (class lto_input_block *ib, class data_in *data_in)
111
kono
parents:
diff changeset
77 {
kono
parents:
diff changeset
78 tree first, prev, curr;
kono
parents:
diff changeset
79
kono
parents:
diff changeset
80 /* The chain is written as NULL terminated list of trees. */
kono
parents:
diff changeset
81 first = prev = NULL_TREE;
kono
parents:
diff changeset
82 do
kono
parents:
diff changeset
83 {
kono
parents:
diff changeset
84 curr = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
85 if (prev)
kono
parents:
diff changeset
86 TREE_CHAIN (prev) = curr;
kono
parents:
diff changeset
87 else
kono
parents:
diff changeset
88 first = curr;
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 prev = curr;
kono
parents:
diff changeset
91 }
kono
parents:
diff changeset
92 while (curr);
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 return first;
kono
parents:
diff changeset
95 }
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97
kono
parents:
diff changeset
98 /* Unpack all the non-pointer fields of the TS_BASE structure of
kono
parents:
diff changeset
99 expression EXPR from bitpack BP. */
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 static inline void
kono
parents:
diff changeset
102 unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
103 {
kono
parents:
diff changeset
104 /* Note that the code for EXPR has already been unpacked to create EXPR in
kono
parents:
diff changeset
105 streamer_alloc_tree. */
kono
parents:
diff changeset
106 if (!TYPE_P (expr))
kono
parents:
diff changeset
107 {
kono
parents:
diff changeset
108 TREE_SIDE_EFFECTS (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
109 TREE_CONSTANT (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
110 TREE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
111
kono
parents:
diff changeset
112 /* TREE_PUBLIC is used on types to indicate that the type
kono
parents:
diff changeset
113 has a TYPE_CACHED_VALUES vector. This is not streamed out,
kono
parents:
diff changeset
114 so we skip it here. */
kono
parents:
diff changeset
115 TREE_PUBLIC (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
116 }
kono
parents:
diff changeset
117 else
kono
parents:
diff changeset
118 bp_unpack_value (bp, 4);
kono
parents:
diff changeset
119 TREE_ADDRESSABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
120 TREE_THIS_VOLATILE (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
121 if (DECL_P (expr))
kono
parents:
diff changeset
122 {
kono
parents:
diff changeset
123 DECL_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
124 DECL_NAMELESS (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
125 }
kono
parents:
diff changeset
126 else if (TYPE_P (expr))
kono
parents:
diff changeset
127 TYPE_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
128 else
kono
parents:
diff changeset
129 bp_unpack_value (bp, 1);
kono
parents:
diff changeset
130 TREE_ASM_WRITTEN (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
131 if (TYPE_P (expr))
kono
parents:
diff changeset
132 TYPE_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
133 else
kono
parents:
diff changeset
134 TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
135 TREE_NOTHROW (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
136 TREE_STATIC (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
137 if (TREE_CODE (expr) != TREE_BINFO)
kono
parents:
diff changeset
138 TREE_PRIVATE (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
139 else
kono
parents:
diff changeset
140 bp_unpack_value (bp, 1);
kono
parents:
diff changeset
141 TREE_PROTECTED (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
142 TREE_DEPRECATED (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
143 if (TYPE_P (expr))
kono
parents:
diff changeset
144 {
kono
parents:
diff changeset
145 if (AGGREGATE_TYPE_P (expr))
kono
parents:
diff changeset
146 TYPE_REVERSE_STORAGE_ORDER (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
147 else
kono
parents:
diff changeset
148 TYPE_SATURATING (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
149 TYPE_ADDR_SPACE (expr) = (unsigned) bp_unpack_value (bp, 8);
kono
parents:
diff changeset
150 }
kono
parents:
diff changeset
151 else if (TREE_CODE (expr) == BIT_FIELD_REF || TREE_CODE (expr) == MEM_REF)
kono
parents:
diff changeset
152 {
kono
parents:
diff changeset
153 REF_REVERSE_STORAGE_ORDER (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
154 bp_unpack_value (bp, 8);
kono
parents:
diff changeset
155 }
kono
parents:
diff changeset
156 else if (TREE_CODE (expr) == SSA_NAME)
kono
parents:
diff changeset
157 {
kono
parents:
diff changeset
158 SSA_NAME_IS_DEFAULT_DEF (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
159 bp_unpack_value (bp, 8);
kono
parents:
diff changeset
160 }
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
161 else if (TREE_CODE (expr) == CALL_EXPR)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
162 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
163 CALL_EXPR_BY_DESCRIPTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
164 bp_unpack_value (bp, 8);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
165 }
111
kono
parents:
diff changeset
166 else
kono
parents:
diff changeset
167 bp_unpack_value (bp, 9);
kono
parents:
diff changeset
168 }
kono
parents:
diff changeset
169
kono
parents:
diff changeset
170
kono
parents:
diff changeset
171 /* Unpack all the non-pointer fields of the TS_INT_CST structure of
kono
parents:
diff changeset
172 expression EXPR from bitpack BP. */
kono
parents:
diff changeset
173
kono
parents:
diff changeset
174 static void
kono
parents:
diff changeset
175 unpack_ts_int_cst_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
176 {
kono
parents:
diff changeset
177 int i;
kono
parents:
diff changeset
178 for (i = 0; i < TREE_INT_CST_EXT_NUNITS (expr); i++)
kono
parents:
diff changeset
179 TREE_INT_CST_ELT (expr, i) = bp_unpack_var_len_int (bp);
kono
parents:
diff changeset
180 }
kono
parents:
diff changeset
181
kono
parents:
diff changeset
182
kono
parents:
diff changeset
183 /* Unpack all the non-pointer fields of the TS_REAL_CST structure of
kono
parents:
diff changeset
184 expression EXPR from bitpack BP. */
kono
parents:
diff changeset
185
kono
parents:
diff changeset
186 static void
kono
parents:
diff changeset
187 unpack_ts_real_cst_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
188 {
kono
parents:
diff changeset
189 unsigned i;
kono
parents:
diff changeset
190 REAL_VALUE_TYPE r;
kono
parents:
diff changeset
191 REAL_VALUE_TYPE *rp;
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 /* Clear all bits of the real value type so that we can later do
kono
parents:
diff changeset
194 bitwise comparisons to see if two values are the same. */
kono
parents:
diff changeset
195 memset (&r, 0, sizeof r);
kono
parents:
diff changeset
196 r.cl = (unsigned) bp_unpack_value (bp, 2);
kono
parents:
diff changeset
197 r.decimal = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
198 r.sign = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
199 r.signalling = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
200 r.canonical = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
201 r.uexp = (unsigned) bp_unpack_value (bp, EXP_BITS);
kono
parents:
diff changeset
202 for (i = 0; i < SIGSZ; i++)
kono
parents:
diff changeset
203 r.sig[i] = (unsigned long) bp_unpack_value (bp, HOST_BITS_PER_LONG);
kono
parents:
diff changeset
204
kono
parents:
diff changeset
205 rp = ggc_alloc<real_value> ();
kono
parents:
diff changeset
206 memcpy (rp, &r, sizeof (REAL_VALUE_TYPE));
kono
parents:
diff changeset
207 TREE_REAL_CST_PTR (expr) = rp;
kono
parents:
diff changeset
208 }
kono
parents:
diff changeset
209
kono
parents:
diff changeset
210
kono
parents:
diff changeset
211 /* Unpack all the non-pointer fields of the TS_FIXED_CST structure of
kono
parents:
diff changeset
212 expression EXPR from bitpack BP. */
kono
parents:
diff changeset
213
kono
parents:
diff changeset
214 static void
kono
parents:
diff changeset
215 unpack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
216 {
kono
parents:
diff changeset
217 FIXED_VALUE_TYPE *fp = ggc_alloc<fixed_value> ();
kono
parents:
diff changeset
218 fp->mode = as_a <scalar_mode> (bp_unpack_machine_mode (bp));
kono
parents:
diff changeset
219 fp->data.low = bp_unpack_var_len_int (bp);
kono
parents:
diff changeset
220 fp->data.high = bp_unpack_var_len_int (bp);
kono
parents:
diff changeset
221 TREE_FIXED_CST_PTR (expr) = fp;
kono
parents:
diff changeset
222 }
kono
parents:
diff changeset
223
kono
parents:
diff changeset
224 /* Unpack all the non-pointer fields of the TS_DECL_COMMON structure
kono
parents:
diff changeset
225 of expression EXPR from bitpack BP. */
kono
parents:
diff changeset
226
kono
parents:
diff changeset
227 static void
kono
parents:
diff changeset
228 unpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
229 {
kono
parents:
diff changeset
230 SET_DECL_MODE (expr, bp_unpack_machine_mode (bp));
kono
parents:
diff changeset
231 DECL_NONLOCAL (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
232 DECL_VIRTUAL_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
233 DECL_IGNORED_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
234 DECL_ABSTRACT_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
235 DECL_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
236 DECL_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
237 DECL_PRESERVE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
238 DECL_EXTERNAL (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
239 DECL_GIMPLE_REG_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
240 SET_DECL_ALIGN (expr, (unsigned) bp_unpack_var_len_unsigned (bp));
kono
parents:
diff changeset
241 #ifdef ACCEL_COMPILER
kono
parents:
diff changeset
242 if (DECL_ALIGN (expr) > targetm.absolute_biggest_alignment)
kono
parents:
diff changeset
243 SET_DECL_ALIGN (expr, targetm.absolute_biggest_alignment);
kono
parents:
diff changeset
244 #endif
kono
parents:
diff changeset
245 if (TREE_CODE (expr) == LABEL_DECL)
kono
parents:
diff changeset
246 {
kono
parents:
diff changeset
247 EH_LANDING_PAD_NR (expr) = (int) bp_unpack_var_len_unsigned (bp);
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 /* Always assume an initial value of -1 for LABEL_DECL_UID to
kono
parents:
diff changeset
250 force gimple_set_bb to recreate label_to_block_map. */
kono
parents:
diff changeset
251 LABEL_DECL_UID (expr) = -1;
kono
parents:
diff changeset
252 }
kono
parents:
diff changeset
253
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
254 else if (TREE_CODE (expr) == FIELD_DECL)
111
kono
parents:
diff changeset
255 {
kono
parents:
diff changeset
256 DECL_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
257 DECL_NONADDRESSABLE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
258 DECL_PADDING_P (expr) = (unsigned) bp_unpack_value (bp, 1);
111
kono
parents:
diff changeset
259 expr->decl_common.off_align = bp_unpack_value (bp, 8);
kono
parents:
diff changeset
260 }
kono
parents:
diff changeset
261
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
262 else if (VAR_P (expr))
111
kono
parents:
diff changeset
263 {
kono
parents:
diff changeset
264 DECL_HAS_DEBUG_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
265 DECL_NONLOCAL_FRAME (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
266 }
kono
parents:
diff changeset
267
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
268 else if (TREE_CODE (expr) == PARM_DECL)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
269 DECL_HIDDEN_STRING_LENGTH (expr) = (unsigned) bp_unpack_value (bp, 1);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
270
111
kono
parents:
diff changeset
271 if (TREE_CODE (expr) == RESULT_DECL
kono
parents:
diff changeset
272 || TREE_CODE (expr) == PARM_DECL
kono
parents:
diff changeset
273 || VAR_P (expr))
kono
parents:
diff changeset
274 {
kono
parents:
diff changeset
275 DECL_BY_REFERENCE (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
276 if (VAR_P (expr) || TREE_CODE (expr) == PARM_DECL)
kono
parents:
diff changeset
277 DECL_HAS_VALUE_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
278 }
kono
parents:
diff changeset
279 }
kono
parents:
diff changeset
280
kono
parents:
diff changeset
281
kono
parents:
diff changeset
282 /* Unpack all the non-pointer fields of the TS_DECL_WRTL structure
kono
parents:
diff changeset
283 of expression EXPR from bitpack BP. */
kono
parents:
diff changeset
284
kono
parents:
diff changeset
285 static void
kono
parents:
diff changeset
286 unpack_ts_decl_wrtl_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
287 {
kono
parents:
diff changeset
288 DECL_REGISTER (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
289 }
kono
parents:
diff changeset
290
kono
parents:
diff changeset
291
kono
parents:
diff changeset
292 /* Unpack all the non-pointer fields of the TS_DECL_WITH_VIS structure
kono
parents:
diff changeset
293 of expression EXPR from bitpack BP. */
kono
parents:
diff changeset
294
kono
parents:
diff changeset
295 static void
kono
parents:
diff changeset
296 unpack_ts_decl_with_vis_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
297 {
kono
parents:
diff changeset
298 DECL_COMMON (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
299 DECL_DLLIMPORT_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
300 DECL_WEAK (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
301 DECL_SEEN_IN_BIND_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
302 DECL_COMDAT (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
303 DECL_VISIBILITY (expr) = (enum symbol_visibility) bp_unpack_value (bp, 2);
kono
parents:
diff changeset
304 DECL_VISIBILITY_SPECIFIED (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
305
kono
parents:
diff changeset
306 if (VAR_P (expr))
kono
parents:
diff changeset
307 {
kono
parents:
diff changeset
308 DECL_HARD_REGISTER (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
309 DECL_IN_CONSTANT_POOL (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
310 }
kono
parents:
diff changeset
311
kono
parents:
diff changeset
312 if (TREE_CODE (expr) == FUNCTION_DECL)
kono
parents:
diff changeset
313 {
kono
parents:
diff changeset
314 DECL_FINAL_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
315 DECL_CXX_CONSTRUCTOR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
316 DECL_CXX_DESTRUCTOR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
317 }
kono
parents:
diff changeset
318 }
kono
parents:
diff changeset
319
kono
parents:
diff changeset
320
kono
parents:
diff changeset
321 /* Unpack all the non-pointer fields of the TS_FUNCTION_DECL structure
kono
parents:
diff changeset
322 of expression EXPR from bitpack BP. */
kono
parents:
diff changeset
323
kono
parents:
diff changeset
324 static void
kono
parents:
diff changeset
325 unpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
326 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
327 built_in_class cl = bp_unpack_enum (bp, built_in_class, BUILT_IN_LAST);
111
kono
parents:
diff changeset
328 DECL_STATIC_CONSTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
329 DECL_STATIC_DESTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
330 DECL_UNINLINABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
331 DECL_POSSIBLY_INLINED (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
332 DECL_IS_NOVOPS (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
333 DECL_IS_RETURNS_TWICE (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
334 DECL_IS_MALLOC (expr) = (unsigned) bp_unpack_value (bp, 1);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
335 DECL_SET_IS_OPERATOR_NEW (expr, (unsigned) bp_unpack_value (bp, 1));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
336 DECL_SET_IS_OPERATOR_DELETE (expr, (unsigned) bp_unpack_value (bp, 1));
111
kono
parents:
diff changeset
337 DECL_DECLARED_INLINE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
338 DECL_STATIC_CHAIN (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
339 DECL_NO_INLINE_WARNING_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
340 DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (expr)
kono
parents:
diff changeset
341 = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
342 DECL_NO_LIMIT_STACK (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
343 DECL_DISREGARD_INLINE_LIMITS (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
344 DECL_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
345 DECL_LOOPING_CONST_OR_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
346 unsigned int fcode = 0;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
347 if (cl != NOT_BUILT_IN)
111
kono
parents:
diff changeset
348 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
349 fcode = bp_unpack_value (bp, 32);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
350 if (cl == BUILT_IN_NORMAL && fcode >= END_BUILTINS)
111
kono
parents:
diff changeset
351 fatal_error (input_location,
kono
parents:
diff changeset
352 "machine independent builtin code out of range");
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
353 else if (cl == BUILT_IN_MD)
111
kono
parents:
diff changeset
354 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
355 tree result = targetm.builtin_decl (fcode, true);
111
kono
parents:
diff changeset
356 if (!result || result == error_mark_node)
kono
parents:
diff changeset
357 fatal_error (input_location,
kono
parents:
diff changeset
358 "target specific builtin not available");
kono
parents:
diff changeset
359 }
kono
parents:
diff changeset
360 }
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
361 set_decl_built_in_function (expr, cl, fcode);
111
kono
parents:
diff changeset
362 }
kono
parents:
diff changeset
363
kono
parents:
diff changeset
364
kono
parents:
diff changeset
365 /* Unpack all the non-pointer fields of the TS_TYPE_COMMON structure
kono
parents:
diff changeset
366 of expression EXPR from bitpack BP. */
kono
parents:
diff changeset
367
kono
parents:
diff changeset
368 static void
kono
parents:
diff changeset
369 unpack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
370 {
kono
parents:
diff changeset
371 machine_mode mode;
kono
parents:
diff changeset
372
kono
parents:
diff changeset
373 mode = bp_unpack_machine_mode (bp);
kono
parents:
diff changeset
374 SET_TYPE_MODE (expr, mode);
kono
parents:
diff changeset
375 /* TYPE_NO_FORCE_BLK is private to stor-layout and need
kono
parents:
diff changeset
376 no streaming. */
kono
parents:
diff changeset
377 TYPE_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
378 TYPE_RESTRICT (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
379 TYPE_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
380 TYPE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
381 TYPE_LANG_FLAG_0 (expr) = (unsigned) bp_unpack_value (bp, 1);
111
kono
parents:
diff changeset
382 if (RECORD_OR_UNION_TYPE_P (expr))
kono
parents:
diff changeset
383 {
kono
parents:
diff changeset
384 TYPE_TRANSPARENT_AGGR (expr) = (unsigned) bp_unpack_value (bp, 1);
kono
parents:
diff changeset
385 TYPE_FINAL_P (expr) = (unsigned) bp_unpack_value (bp, 1);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
386 TYPE_CXX_ODR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
111
kono
parents:
diff changeset
387 }
kono
parents:
diff changeset
388 else if (TREE_CODE (expr) == ARRAY_TYPE)
kono
parents:
diff changeset
389 TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
390 if (TREE_CODE (expr) == ARRAY_TYPE || TREE_CODE (expr) == INTEGER_TYPE)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
391 TYPE_STRING_FLAG (expr) = (unsigned) bp_unpack_value (bp, 1);
111
kono
parents:
diff changeset
392 if (AGGREGATE_TYPE_P (expr))
kono
parents:
diff changeset
393 TYPE_TYPELESS_STORAGE (expr) = (unsigned) bp_unpack_value (bp, 1);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
394 TYPE_EMPTY_P (expr) = (unsigned) bp_unpack_value (bp, 1);
111
kono
parents:
diff changeset
395 TYPE_PRECISION (expr) = bp_unpack_var_len_unsigned (bp);
kono
parents:
diff changeset
396 SET_TYPE_ALIGN (expr, bp_unpack_var_len_unsigned (bp));
kono
parents:
diff changeset
397 #ifdef ACCEL_COMPILER
kono
parents:
diff changeset
398 if (TYPE_ALIGN (expr) > targetm.absolute_biggest_alignment)
kono
parents:
diff changeset
399 SET_TYPE_ALIGN (expr, targetm.absolute_biggest_alignment);
kono
parents:
diff changeset
400 #endif
kono
parents:
diff changeset
401 }
kono
parents:
diff changeset
402
kono
parents:
diff changeset
403
kono
parents:
diff changeset
404 /* Unpack all the non-pointer fields of the TS_BLOCK structure
kono
parents:
diff changeset
405 of expression EXPR from bitpack BP. */
kono
parents:
diff changeset
406
kono
parents:
diff changeset
407 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
408 unpack_ts_block_value_fields (class data_in *data_in,
111
kono
parents:
diff changeset
409 struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
410 {
kono
parents:
diff changeset
411 /* BLOCK_NUMBER is recomputed. */
kono
parents:
diff changeset
412 stream_input_location (&BLOCK_SOURCE_LOCATION (expr), bp, data_in);
kono
parents:
diff changeset
413 }
kono
parents:
diff changeset
414
kono
parents:
diff changeset
415 /* Unpack all the non-pointer fields of the TS_TRANSLATION_UNIT_DECL
kono
parents:
diff changeset
416 structure of expression EXPR from bitpack BP. */
kono
parents:
diff changeset
417
kono
parents:
diff changeset
418 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
419 unpack_ts_translation_unit_decl_value_fields (class data_in *data_in,
111
kono
parents:
diff changeset
420 struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
421 {
kono
parents:
diff changeset
422 TRANSLATION_UNIT_LANGUAGE (expr) = xstrdup (bp_unpack_string (data_in, bp));
kono
parents:
diff changeset
423 vec_safe_push (all_translation_units, expr);
kono
parents:
diff changeset
424 }
kono
parents:
diff changeset
425
kono
parents:
diff changeset
426
kono
parents:
diff changeset
427 /* Unpack all the non-pointer fields of the TS_OMP_CLAUSE
kono
parents:
diff changeset
428 structure of expression EXPR from bitpack BP. */
kono
parents:
diff changeset
429
kono
parents:
diff changeset
430 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
431 unpack_ts_omp_clause_value_fields (class data_in *data_in,
111
kono
parents:
diff changeset
432 struct bitpack_d *bp, tree expr)
kono
parents:
diff changeset
433 {
kono
parents:
diff changeset
434 stream_input_location (&OMP_CLAUSE_LOCATION (expr), bp, data_in);
kono
parents:
diff changeset
435 switch (OMP_CLAUSE_CODE (expr))
kono
parents:
diff changeset
436 {
kono
parents:
diff changeset
437 case OMP_CLAUSE_DEFAULT:
kono
parents:
diff changeset
438 OMP_CLAUSE_DEFAULT_KIND (expr)
kono
parents:
diff changeset
439 = bp_unpack_enum (bp, omp_clause_default_kind,
kono
parents:
diff changeset
440 OMP_CLAUSE_DEFAULT_LAST);
kono
parents:
diff changeset
441 break;
kono
parents:
diff changeset
442 case OMP_CLAUSE_SCHEDULE:
kono
parents:
diff changeset
443 OMP_CLAUSE_SCHEDULE_KIND (expr)
kono
parents:
diff changeset
444 = bp_unpack_enum (bp, omp_clause_schedule_kind,
kono
parents:
diff changeset
445 OMP_CLAUSE_SCHEDULE_LAST);
kono
parents:
diff changeset
446 break;
kono
parents:
diff changeset
447 case OMP_CLAUSE_DEPEND:
kono
parents:
diff changeset
448 OMP_CLAUSE_DEPEND_KIND (expr)
kono
parents:
diff changeset
449 = bp_unpack_enum (bp, omp_clause_depend_kind, OMP_CLAUSE_DEPEND_LAST);
kono
parents:
diff changeset
450 break;
kono
parents:
diff changeset
451 case OMP_CLAUSE_MAP:
kono
parents:
diff changeset
452 OMP_CLAUSE_SET_MAP_KIND (expr, bp_unpack_enum (bp, gomp_map_kind,
kono
parents:
diff changeset
453 GOMP_MAP_LAST));
kono
parents:
diff changeset
454 break;
kono
parents:
diff changeset
455 case OMP_CLAUSE_PROC_BIND:
kono
parents:
diff changeset
456 OMP_CLAUSE_PROC_BIND_KIND (expr)
kono
parents:
diff changeset
457 = bp_unpack_enum (bp, omp_clause_proc_bind_kind,
kono
parents:
diff changeset
458 OMP_CLAUSE_PROC_BIND_LAST);
kono
parents:
diff changeset
459 break;
kono
parents:
diff changeset
460 case OMP_CLAUSE_REDUCTION:
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
461 case OMP_CLAUSE_TASK_REDUCTION:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
462 case OMP_CLAUSE_IN_REDUCTION:
111
kono
parents:
diff changeset
463 OMP_CLAUSE_REDUCTION_CODE (expr)
kono
parents:
diff changeset
464 = bp_unpack_enum (bp, tree_code, MAX_TREE_CODES);
kono
parents:
diff changeset
465 break;
kono
parents:
diff changeset
466 default:
kono
parents:
diff changeset
467 break;
kono
parents:
diff changeset
468 }
kono
parents:
diff changeset
469 }
kono
parents:
diff changeset
470
kono
parents:
diff changeset
471
kono
parents:
diff changeset
472 /* Read all the language-independent bitfield values for EXPR from IB.
kono
parents:
diff changeset
473 Return the partially unpacked bitpack so the caller can unpack any other
kono
parents:
diff changeset
474 bitfield values that the writer may have written. */
kono
parents:
diff changeset
475
kono
parents:
diff changeset
476 void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
477 streamer_read_tree_bitfields (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
478 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
479 {
kono
parents:
diff changeset
480 enum tree_code code;
kono
parents:
diff changeset
481 struct bitpack_d bp;
kono
parents:
diff changeset
482
kono
parents:
diff changeset
483 /* Read the bitpack of non-pointer values from IB. */
kono
parents:
diff changeset
484 bp = streamer_read_bitpack (ib);
kono
parents:
diff changeset
485
kono
parents:
diff changeset
486 /* The first word in BP contains the code of the tree that we
kono
parents:
diff changeset
487 are about to read. */
kono
parents:
diff changeset
488 code = (enum tree_code) bp_unpack_value (&bp, 16);
kono
parents:
diff changeset
489 lto_tag_check (lto_tree_code_to_tag (code),
kono
parents:
diff changeset
490 lto_tree_code_to_tag (TREE_CODE (expr)));
kono
parents:
diff changeset
491
kono
parents:
diff changeset
492 /* Note that all these functions are highly sensitive to changes in
kono
parents:
diff changeset
493 the types and sizes of each of the fields being packed. */
kono
parents:
diff changeset
494 unpack_ts_base_value_fields (&bp, expr);
kono
parents:
diff changeset
495
kono
parents:
diff changeset
496 if (CODE_CONTAINS_STRUCT (code, TS_INT_CST))
kono
parents:
diff changeset
497 unpack_ts_int_cst_value_fields (&bp, expr);
kono
parents:
diff changeset
498
kono
parents:
diff changeset
499 if (CODE_CONTAINS_STRUCT (code, TS_REAL_CST))
kono
parents:
diff changeset
500 unpack_ts_real_cst_value_fields (&bp, expr);
kono
parents:
diff changeset
501
kono
parents:
diff changeset
502 if (CODE_CONTAINS_STRUCT (code, TS_FIXED_CST))
kono
parents:
diff changeset
503 unpack_ts_fixed_cst_value_fields (&bp, expr);
kono
parents:
diff changeset
504
kono
parents:
diff changeset
505 if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
kono
parents:
diff changeset
506 stream_input_location (&DECL_SOURCE_LOCATION (expr), &bp, data_in);
kono
parents:
diff changeset
507
kono
parents:
diff changeset
508 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
kono
parents:
diff changeset
509 unpack_ts_decl_common_value_fields (&bp, expr);
kono
parents:
diff changeset
510
kono
parents:
diff changeset
511 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL))
kono
parents:
diff changeset
512 unpack_ts_decl_wrtl_value_fields (&bp, expr);
kono
parents:
diff changeset
513
kono
parents:
diff changeset
514 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
kono
parents:
diff changeset
515 unpack_ts_decl_with_vis_value_fields (&bp, expr);
kono
parents:
diff changeset
516
kono
parents:
diff changeset
517 if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
kono
parents:
diff changeset
518 unpack_ts_function_decl_value_fields (&bp, expr);
kono
parents:
diff changeset
519
kono
parents:
diff changeset
520 if (CODE_CONTAINS_STRUCT (code, TS_TYPE_COMMON))
kono
parents:
diff changeset
521 unpack_ts_type_common_value_fields (&bp, expr);
kono
parents:
diff changeset
522
kono
parents:
diff changeset
523 if (CODE_CONTAINS_STRUCT (code, TS_EXP))
kono
parents:
diff changeset
524 {
kono
parents:
diff changeset
525 stream_input_location (&EXPR_CHECK (expr)->exp.locus, &bp, data_in);
kono
parents:
diff changeset
526 if (code == MEM_REF
kono
parents:
diff changeset
527 || code == TARGET_MEM_REF)
kono
parents:
diff changeset
528 {
kono
parents:
diff changeset
529 MR_DEPENDENCE_CLIQUE (expr)
kono
parents:
diff changeset
530 = (unsigned)bp_unpack_value (&bp, sizeof (short) * 8);
kono
parents:
diff changeset
531 if (MR_DEPENDENCE_CLIQUE (expr) != 0)
kono
parents:
diff changeset
532 MR_DEPENDENCE_BASE (expr)
kono
parents:
diff changeset
533 = (unsigned)bp_unpack_value (&bp, sizeof (short) * 8);
kono
parents:
diff changeset
534 }
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
535 else if (code == CALL_EXPR)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
536 CALL_EXPR_IFN (expr) = bp_unpack_enum (&bp, internal_fn, IFN_LAST);
111
kono
parents:
diff changeset
537 }
kono
parents:
diff changeset
538
kono
parents:
diff changeset
539 if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
kono
parents:
diff changeset
540 unpack_ts_block_value_fields (data_in, &bp, expr);
kono
parents:
diff changeset
541
kono
parents:
diff changeset
542 if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
kono
parents:
diff changeset
543 unpack_ts_translation_unit_decl_value_fields (data_in, &bp, expr);
kono
parents:
diff changeset
544
kono
parents:
diff changeset
545 if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
546 cl_optimization_stream_in (data_in, &bp, TREE_OPTIMIZATION (expr));
111
kono
parents:
diff changeset
547
kono
parents:
diff changeset
548 if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
kono
parents:
diff changeset
549 {
kono
parents:
diff changeset
550 unsigned HOST_WIDE_INT length = bp_unpack_var_len_unsigned (&bp);
kono
parents:
diff changeset
551 if (length > 0)
kono
parents:
diff changeset
552 vec_safe_grow (CONSTRUCTOR_ELTS (expr), length);
kono
parents:
diff changeset
553 }
kono
parents:
diff changeset
554
kono
parents:
diff changeset
555 #ifndef ACCEL_COMPILER
kono
parents:
diff changeset
556 if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
kono
parents:
diff changeset
557 {
kono
parents:
diff changeset
558 cl_target_option_stream_in (data_in, &bp, TREE_TARGET_OPTION (expr));
kono
parents:
diff changeset
559 if (targetm.target_option.post_stream_in)
kono
parents:
diff changeset
560 targetm.target_option.post_stream_in (TREE_TARGET_OPTION (expr));
kono
parents:
diff changeset
561 }
kono
parents:
diff changeset
562 #endif
kono
parents:
diff changeset
563
kono
parents:
diff changeset
564 if (code == OMP_CLAUSE)
kono
parents:
diff changeset
565 unpack_ts_omp_clause_value_fields (data_in, &bp, expr);
kono
parents:
diff changeset
566 }
kono
parents:
diff changeset
567
kono
parents:
diff changeset
568
kono
parents:
diff changeset
569 /* Materialize a new tree from input block IB using descriptors in
kono
parents:
diff changeset
570 DATA_IN. The code for the new tree should match TAG. Store in
kono
parents:
diff changeset
571 *IX_P the index into the reader cache where the new tree is stored. */
kono
parents:
diff changeset
572
kono
parents:
diff changeset
573 tree
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
574 streamer_alloc_tree (class lto_input_block *ib, class data_in *data_in,
111
kono
parents:
diff changeset
575 enum LTO_tags tag)
kono
parents:
diff changeset
576 {
kono
parents:
diff changeset
577 enum tree_code code;
kono
parents:
diff changeset
578 tree result;
kono
parents:
diff changeset
579
kono
parents:
diff changeset
580 result = NULL_TREE;
kono
parents:
diff changeset
581
kono
parents:
diff changeset
582 code = lto_tag_to_tree_code (tag);
kono
parents:
diff changeset
583
kono
parents:
diff changeset
584 /* We should never see an SSA_NAME tree. Only the version numbers of
kono
parents:
diff changeset
585 SSA names are ever written out. See input_ssa_names. */
kono
parents:
diff changeset
586 gcc_assert (code != SSA_NAME);
kono
parents:
diff changeset
587
kono
parents:
diff changeset
588 /* Instantiate a new tree using the header data. */
kono
parents:
diff changeset
589 if (CODE_CONTAINS_STRUCT (code, TS_STRING))
kono
parents:
diff changeset
590 result = streamer_read_string_cst (data_in, ib);
kono
parents:
diff changeset
591 else if (CODE_CONTAINS_STRUCT (code, TS_IDENTIFIER))
kono
parents:
diff changeset
592 result = input_identifier (data_in, ib);
kono
parents:
diff changeset
593 else if (CODE_CONTAINS_STRUCT (code, TS_VEC))
kono
parents:
diff changeset
594 {
kono
parents:
diff changeset
595 HOST_WIDE_INT len = streamer_read_hwi (ib);
kono
parents:
diff changeset
596 result = make_tree_vec (len);
kono
parents:
diff changeset
597 }
kono
parents:
diff changeset
598 else if (CODE_CONTAINS_STRUCT (code, TS_VECTOR))
kono
parents:
diff changeset
599 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
600 bitpack_d bp = streamer_read_bitpack (ib);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
601 unsigned int log2_npatterns = bp_unpack_value (&bp, 8);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
602 unsigned int nelts_per_pattern = bp_unpack_value (&bp, 8);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
603 result = make_vector (log2_npatterns, nelts_per_pattern);
111
kono
parents:
diff changeset
604 }
kono
parents:
diff changeset
605 else if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
kono
parents:
diff changeset
606 {
kono
parents:
diff changeset
607 unsigned HOST_WIDE_INT len = streamer_read_uhwi (ib);
kono
parents:
diff changeset
608 result = make_tree_binfo (len);
kono
parents:
diff changeset
609 }
kono
parents:
diff changeset
610 else if (CODE_CONTAINS_STRUCT (code, TS_INT_CST))
kono
parents:
diff changeset
611 {
kono
parents:
diff changeset
612 unsigned HOST_WIDE_INT len = streamer_read_uhwi (ib);
kono
parents:
diff changeset
613 unsigned HOST_WIDE_INT ext_len = streamer_read_uhwi (ib);
kono
parents:
diff changeset
614 result = make_int_cst (len, ext_len);
kono
parents:
diff changeset
615 }
kono
parents:
diff changeset
616 else if (code == CALL_EXPR)
kono
parents:
diff changeset
617 {
kono
parents:
diff changeset
618 unsigned HOST_WIDE_INT nargs = streamer_read_uhwi (ib);
kono
parents:
diff changeset
619 return build_vl_exp (CALL_EXPR, nargs + 3);
kono
parents:
diff changeset
620 }
kono
parents:
diff changeset
621 else if (code == OMP_CLAUSE)
kono
parents:
diff changeset
622 {
kono
parents:
diff changeset
623 enum omp_clause_code subcode
kono
parents:
diff changeset
624 = (enum omp_clause_code) streamer_read_uhwi (ib);
kono
parents:
diff changeset
625 return build_omp_clause (UNKNOWN_LOCATION, subcode);
kono
parents:
diff changeset
626 }
kono
parents:
diff changeset
627 else
kono
parents:
diff changeset
628 {
kono
parents:
diff changeset
629 /* For all other nodes, materialize the tree with a raw
kono
parents:
diff changeset
630 make_node call. */
kono
parents:
diff changeset
631 result = make_node (code);
kono
parents:
diff changeset
632 }
kono
parents:
diff changeset
633
kono
parents:
diff changeset
634 return result;
kono
parents:
diff changeset
635 }
kono
parents:
diff changeset
636
kono
parents:
diff changeset
637
kono
parents:
diff changeset
638 /* Read all pointer fields in the TS_COMMON structure of EXPR from input
kono
parents:
diff changeset
639 block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
640 file being read. */
kono
parents:
diff changeset
641
kono
parents:
diff changeset
642
kono
parents:
diff changeset
643 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
644 lto_input_ts_common_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
645 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
646 {
kono
parents:
diff changeset
647 if (TREE_CODE (expr) != IDENTIFIER_NODE)
kono
parents:
diff changeset
648 TREE_TYPE (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
649 }
kono
parents:
diff changeset
650
kono
parents:
diff changeset
651
kono
parents:
diff changeset
652 /* Read all pointer fields in the TS_VECTOR structure of EXPR from input
kono
parents:
diff changeset
653 block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
654 file being read. */
kono
parents:
diff changeset
655
kono
parents:
diff changeset
656 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
657 lto_input_ts_vector_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
658 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
659 {
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
660 unsigned int count = vector_cst_encoded_nelts (expr);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
661 for (unsigned int i = 0; i < count; ++i)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
662 VECTOR_CST_ENCODED_ELT (expr, i) = stream_read_tree (ib, data_in);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
663 }
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
664
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
665
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
666 /* Read all pointer fields in the TS_POLY_INT_CST structure of EXPR from
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
667 input block IB. DATA_IN contains tables and descriptors for the
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
668 file being read. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
669
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
670 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
671 lto_input_ts_poly_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
672 class data_in *data_in, tree expr)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
673 {
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
674 for (unsigned int i = 0; i < NUM_POLY_INT_COEFFS; ++i)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
675 POLY_INT_CST_COEFF (expr, i) = stream_read_tree (ib, data_in);
111
kono
parents:
diff changeset
676 }
kono
parents:
diff changeset
677
kono
parents:
diff changeset
678
kono
parents:
diff changeset
679 /* Read all pointer fields in the TS_COMPLEX structure of EXPR from input
kono
parents:
diff changeset
680 block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
681 file being read. */
kono
parents:
diff changeset
682
kono
parents:
diff changeset
683 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
684 lto_input_ts_complex_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
685 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
686 {
kono
parents:
diff changeset
687 TREE_REALPART (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
688 TREE_IMAGPART (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
689 }
kono
parents:
diff changeset
690
kono
parents:
diff changeset
691
kono
parents:
diff changeset
692 /* Read all pointer fields in the TS_DECL_MINIMAL structure of EXPR
kono
parents:
diff changeset
693 from input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
694 file being read. */
kono
parents:
diff changeset
695
kono
parents:
diff changeset
696 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
697 lto_input_ts_decl_minimal_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
698 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
699 {
kono
parents:
diff changeset
700 DECL_NAME (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
701 DECL_CONTEXT (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
702 }
kono
parents:
diff changeset
703
kono
parents:
diff changeset
704
kono
parents:
diff changeset
705 /* Read all pointer fields in the TS_DECL_COMMON structure of EXPR from
kono
parents:
diff changeset
706 input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
707 file being read. */
kono
parents:
diff changeset
708
kono
parents:
diff changeset
709 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
710 lto_input_ts_decl_common_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
711 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
712 {
kono
parents:
diff changeset
713 DECL_SIZE (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
714 DECL_SIZE_UNIT (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
715 DECL_ATTRIBUTES (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
716 DECL_ABSTRACT_ORIGIN (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
717
kono
parents:
diff changeset
718 if ((VAR_P (expr) || TREE_CODE (expr) == PARM_DECL)
kono
parents:
diff changeset
719 && DECL_HAS_VALUE_EXPR_P (expr))
kono
parents:
diff changeset
720 SET_DECL_VALUE_EXPR (expr, stream_read_tree (ib, data_in));
kono
parents:
diff changeset
721
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
722 if (VAR_P (expr)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
723 && DECL_HAS_DEBUG_EXPR_P (expr))
111
kono
parents:
diff changeset
724 {
kono
parents:
diff changeset
725 tree dexpr = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
726 if (dexpr)
kono
parents:
diff changeset
727 SET_DECL_DEBUG_EXPR (expr, dexpr);
kono
parents:
diff changeset
728 }
kono
parents:
diff changeset
729 }
kono
parents:
diff changeset
730
kono
parents:
diff changeset
731
kono
parents:
diff changeset
732 /* Read all pointer fields in the TS_DECL_NON_COMMON structure of
kono
parents:
diff changeset
733 EXPR from input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
734 file being read. */
kono
parents:
diff changeset
735
kono
parents:
diff changeset
736 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
737 lto_input_ts_decl_non_common_tree_pointers (class lto_input_block *,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
738 class data_in *, tree)
111
kono
parents:
diff changeset
739 {
kono
parents:
diff changeset
740 }
kono
parents:
diff changeset
741
kono
parents:
diff changeset
742
kono
parents:
diff changeset
743 /* Read all pointer fields in the TS_DECL_WITH_VIS structure of EXPR
kono
parents:
diff changeset
744 from input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
745 file being read. */
kono
parents:
diff changeset
746
kono
parents:
diff changeset
747 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
748 lto_input_ts_decl_with_vis_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
749 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
750 {
kono
parents:
diff changeset
751 tree id;
kono
parents:
diff changeset
752
kono
parents:
diff changeset
753 id = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
754 if (id)
kono
parents:
diff changeset
755 {
kono
parents:
diff changeset
756 gcc_assert (TREE_CODE (id) == IDENTIFIER_NODE);
kono
parents:
diff changeset
757 SET_DECL_ASSEMBLER_NAME (expr, id);
kono
parents:
diff changeset
758 }
kono
parents:
diff changeset
759 }
kono
parents:
diff changeset
760
kono
parents:
diff changeset
761
kono
parents:
diff changeset
762 /* Read all pointer fields in the TS_FIELD_DECL structure of EXPR from
kono
parents:
diff changeset
763 input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
764 file being read. */
kono
parents:
diff changeset
765
kono
parents:
diff changeset
766 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
767 lto_input_ts_field_decl_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
768 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
769 {
kono
parents:
diff changeset
770 DECL_FIELD_OFFSET (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
771 DECL_BIT_FIELD_TYPE (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
772 DECL_BIT_FIELD_REPRESENTATIVE (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
773 DECL_FIELD_BIT_OFFSET (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
774 }
kono
parents:
diff changeset
775
kono
parents:
diff changeset
776
kono
parents:
diff changeset
777 /* Read all pointer fields in the TS_FUNCTION_DECL structure of EXPR
kono
parents:
diff changeset
778 from input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
779 file being read. */
kono
parents:
diff changeset
780
kono
parents:
diff changeset
781 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
782 lto_input_ts_function_decl_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
783 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
784 {
kono
parents:
diff changeset
785 /* DECL_STRUCT_FUNCTION is loaded on demand by cgraph_get_body. */
kono
parents:
diff changeset
786 DECL_FUNCTION_PERSONALITY (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
787 #ifndef ACCEL_COMPILER
kono
parents:
diff changeset
788 DECL_FUNCTION_SPECIFIC_TARGET (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
789 #endif
kono
parents:
diff changeset
790 DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
791 #ifdef ACCEL_COMPILER
kono
parents:
diff changeset
792 {
kono
parents:
diff changeset
793 tree opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr);
kono
parents:
diff changeset
794 if (opts)
kono
parents:
diff changeset
795 {
kono
parents:
diff changeset
796 struct gcc_options tmp;
kono
parents:
diff changeset
797 init_options_struct (&tmp, NULL);
kono
parents:
diff changeset
798 cl_optimization_restore (&tmp, TREE_OPTIMIZATION (opts));
kono
parents:
diff changeset
799 finish_options (&tmp, &global_options_set, UNKNOWN_LOCATION);
kono
parents:
diff changeset
800 opts = build_optimization_node (&tmp);
kono
parents:
diff changeset
801 DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr) = opts;
kono
parents:
diff changeset
802 }
kono
parents:
diff changeset
803 }
kono
parents:
diff changeset
804 #endif
kono
parents:
diff changeset
805 }
kono
parents:
diff changeset
806
kono
parents:
diff changeset
807
kono
parents:
diff changeset
808 /* Read all pointer fields in the TS_TYPE_COMMON structure of EXPR from
kono
parents:
diff changeset
809 input block IB. DATA_IN contains tables and descriptors for the file
kono
parents:
diff changeset
810 being read. */
kono
parents:
diff changeset
811
kono
parents:
diff changeset
812 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
813 lto_input_ts_type_common_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
814 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
815 {
kono
parents:
diff changeset
816 TYPE_SIZE (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
817 TYPE_SIZE_UNIT (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
818 TYPE_ATTRIBUTES (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
819 TYPE_NAME (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
820 /* Do not stream TYPE_POINTER_TO or TYPE_REFERENCE_TO. They will be
kono
parents:
diff changeset
821 reconstructed during fixup. */
kono
parents:
diff changeset
822 /* Do not stream TYPE_NEXT_VARIANT, we reconstruct the variant lists
kono
parents:
diff changeset
823 during fixup. */
kono
parents:
diff changeset
824 TYPE_MAIN_VARIANT (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
825 TYPE_CONTEXT (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
826 /* TYPE_CANONICAL gets re-computed during type merging. */
kono
parents:
diff changeset
827 TYPE_CANONICAL (expr) = NULL_TREE;
kono
parents:
diff changeset
828 }
kono
parents:
diff changeset
829
kono
parents:
diff changeset
830 /* Read all pointer fields in the TS_TYPE_NON_COMMON structure of EXPR
kono
parents:
diff changeset
831 from input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
832 file being read. */
kono
parents:
diff changeset
833
kono
parents:
diff changeset
834 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
835 lto_input_ts_type_non_common_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
836 class data_in *data_in,
111
kono
parents:
diff changeset
837 tree expr)
kono
parents:
diff changeset
838 {
kono
parents:
diff changeset
839 if (TREE_CODE (expr) == ENUMERAL_TYPE)
kono
parents:
diff changeset
840 TYPE_VALUES (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
841 else if (TREE_CODE (expr) == ARRAY_TYPE)
kono
parents:
diff changeset
842 TYPE_DOMAIN (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
843 else if (RECORD_OR_UNION_TYPE_P (expr))
kono
parents:
diff changeset
844 TYPE_FIELDS (expr) = streamer_read_chain (ib, data_in);
kono
parents:
diff changeset
845 else if (TREE_CODE (expr) == FUNCTION_TYPE
kono
parents:
diff changeset
846 || TREE_CODE (expr) == METHOD_TYPE)
kono
parents:
diff changeset
847 TYPE_ARG_TYPES (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
848
kono
parents:
diff changeset
849 if (!POINTER_TYPE_P (expr))
kono
parents:
diff changeset
850 TYPE_MIN_VALUE_RAW (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
851 TYPE_MAX_VALUE_RAW (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
852 }
kono
parents:
diff changeset
853
kono
parents:
diff changeset
854
kono
parents:
diff changeset
855 /* Read all pointer fields in the TS_LIST structure of EXPR from input
kono
parents:
diff changeset
856 block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
857 file being read. */
kono
parents:
diff changeset
858
kono
parents:
diff changeset
859 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
860 lto_input_ts_list_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
861 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
862 {
kono
parents:
diff changeset
863 TREE_PURPOSE (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
864 TREE_VALUE (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
865 TREE_CHAIN (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
866 }
kono
parents:
diff changeset
867
kono
parents:
diff changeset
868
kono
parents:
diff changeset
869 /* Read all pointer fields in the TS_VEC structure of EXPR from input
kono
parents:
diff changeset
870 block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
871 file being read. */
kono
parents:
diff changeset
872
kono
parents:
diff changeset
873 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
874 lto_input_ts_vec_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
875 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
876 {
kono
parents:
diff changeset
877 int i;
kono
parents:
diff changeset
878
kono
parents:
diff changeset
879 /* Note that TREE_VEC_LENGTH was read by streamer_alloc_tree to
kono
parents:
diff changeset
880 instantiate EXPR. */
kono
parents:
diff changeset
881 for (i = 0; i < TREE_VEC_LENGTH (expr); i++)
kono
parents:
diff changeset
882 TREE_VEC_ELT (expr, i) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
883 }
kono
parents:
diff changeset
884
kono
parents:
diff changeset
885
kono
parents:
diff changeset
886 /* Read all pointer fields in the TS_EXP structure of EXPR from input
kono
parents:
diff changeset
887 block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
888 file being read. */
kono
parents:
diff changeset
889
kono
parents:
diff changeset
890
kono
parents:
diff changeset
891 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
892 lto_input_ts_exp_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
893 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
894 {
kono
parents:
diff changeset
895 int i;
kono
parents:
diff changeset
896 tree block;
kono
parents:
diff changeset
897
kono
parents:
diff changeset
898 for (i = 0; i < TREE_OPERAND_LENGTH (expr); i++)
kono
parents:
diff changeset
899 TREE_OPERAND (expr, i) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
900
kono
parents:
diff changeset
901 block = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
902
kono
parents:
diff changeset
903 /* TODO: Block is stored in the locus information. It may make more sense to
kono
parents:
diff changeset
904 to make it go via the location cache. */
kono
parents:
diff changeset
905 if (block)
kono
parents:
diff changeset
906 {
kono
parents:
diff changeset
907 data_in->location_cache.apply_location_cache ();
kono
parents:
diff changeset
908 TREE_SET_BLOCK (expr, block);
kono
parents:
diff changeset
909 }
kono
parents:
diff changeset
910 }
kono
parents:
diff changeset
911
kono
parents:
diff changeset
912
kono
parents:
diff changeset
913 /* Read all pointer fields in the TS_BLOCK structure of EXPR from input
kono
parents:
diff changeset
914 block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
915 file being read. */
kono
parents:
diff changeset
916
kono
parents:
diff changeset
917 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
918 lto_input_ts_block_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
919 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
920 {
kono
parents:
diff changeset
921 BLOCK_VARS (expr) = streamer_read_chain (ib, data_in);
kono
parents:
diff changeset
922
kono
parents:
diff changeset
923 BLOCK_SUPERCONTEXT (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
924 BLOCK_ABSTRACT_ORIGIN (expr) = stream_read_tree (ib, data_in);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
925 /* We may end up prevailing a decl with DECL_ORIGIN (t) != t here
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
926 which breaks the invariant that BLOCK_ABSTRACT_ORIGIN is the
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
927 ultimate origin. Fixup here.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
928 ??? This should get fixed with moving to DIE references. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
929 if (DECL_P (BLOCK_ORIGIN (expr)))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
930 BLOCK_ABSTRACT_ORIGIN (expr) = DECL_ORIGIN (BLOCK_ABSTRACT_ORIGIN (expr));
111
kono
parents:
diff changeset
931 /* Do not stream BLOCK_NONLOCALIZED_VARS. We cannot handle debug information
kono
parents:
diff changeset
932 for early inlined BLOCKs so drop it on the floor instead of ICEing in
kono
parents:
diff changeset
933 dwarf2out.c. */
kono
parents:
diff changeset
934
kono
parents:
diff changeset
935 /* BLOCK_FRAGMENT_ORIGIN and BLOCK_FRAGMENT_CHAIN is not live at LTO
kono
parents:
diff changeset
936 streaming time. */
kono
parents:
diff changeset
937
kono
parents:
diff changeset
938 /* We re-compute BLOCK_SUBBLOCKS of our parent here instead
kono
parents:
diff changeset
939 of streaming it. For non-BLOCK BLOCK_SUPERCONTEXTs we still
kono
parents:
diff changeset
940 stream the child relationship explicitly. */
kono
parents:
diff changeset
941 if (BLOCK_SUPERCONTEXT (expr)
kono
parents:
diff changeset
942 && TREE_CODE (BLOCK_SUPERCONTEXT (expr)) == BLOCK)
kono
parents:
diff changeset
943 {
kono
parents:
diff changeset
944 BLOCK_CHAIN (expr) = BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr));
kono
parents:
diff changeset
945 BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr)) = expr;
kono
parents:
diff changeset
946 }
kono
parents:
diff changeset
947
kono
parents:
diff changeset
948 /* The global block is rooted at the TU decl. Hook it here to
kono
parents:
diff changeset
949 avoid the need to stream in this block during WPA time. */
kono
parents:
diff changeset
950 else if (BLOCK_SUPERCONTEXT (expr)
kono
parents:
diff changeset
951 && TREE_CODE (BLOCK_SUPERCONTEXT (expr)) == TRANSLATION_UNIT_DECL)
kono
parents:
diff changeset
952 DECL_INITIAL (BLOCK_SUPERCONTEXT (expr)) = expr;
kono
parents:
diff changeset
953
kono
parents:
diff changeset
954 /* The function-level block is connected at the time we read in
kono
parents:
diff changeset
955 function bodies for the same reason. */
kono
parents:
diff changeset
956 }
kono
parents:
diff changeset
957
kono
parents:
diff changeset
958
kono
parents:
diff changeset
959 /* Read all pointer fields in the TS_BINFO structure of EXPR from input
kono
parents:
diff changeset
960 block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
961 file being read. */
kono
parents:
diff changeset
962
kono
parents:
diff changeset
963 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
964 lto_input_ts_binfo_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
965 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
966 {
kono
parents:
diff changeset
967 tree t;
kono
parents:
diff changeset
968
kono
parents:
diff changeset
969 /* Note that the number of slots in EXPR was read in
kono
parents:
diff changeset
970 streamer_alloc_tree when instantiating EXPR. However, the
kono
parents:
diff changeset
971 vector is empty so we cannot rely on vec::length to know how many
kono
parents:
diff changeset
972 elements to read. So, this list is emitted as a 0-terminated
kono
parents:
diff changeset
973 list on the writer side. */
kono
parents:
diff changeset
974 do
kono
parents:
diff changeset
975 {
kono
parents:
diff changeset
976 t = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
977 if (t)
kono
parents:
diff changeset
978 BINFO_BASE_BINFOS (expr)->quick_push (t);
kono
parents:
diff changeset
979 }
kono
parents:
diff changeset
980 while (t);
kono
parents:
diff changeset
981
kono
parents:
diff changeset
982 BINFO_OFFSET (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
983 BINFO_VTABLE (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
984
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
985 /* Do not walk BINFO_INHERITANCE_CHAIN, BINFO_SUBVTT_INDEX,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
986 BINFO_BASE_ACCESSES and BINFO_VPTR_INDEX; these are used by C++ FE
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
987 only. */
111
kono
parents:
diff changeset
988 }
kono
parents:
diff changeset
989
kono
parents:
diff changeset
990
kono
parents:
diff changeset
991 /* Read all pointer fields in the TS_CONSTRUCTOR structure of EXPR from
kono
parents:
diff changeset
992 input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
993 file being read. */
kono
parents:
diff changeset
994
kono
parents:
diff changeset
995 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
996 lto_input_ts_constructor_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
997 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
998 {
kono
parents:
diff changeset
999 unsigned i;
kono
parents:
diff changeset
1000
kono
parents:
diff changeset
1001 for (i = 0; i < CONSTRUCTOR_NELTS (expr); i++)
kono
parents:
diff changeset
1002 {
kono
parents:
diff changeset
1003 constructor_elt e;
kono
parents:
diff changeset
1004 e.index = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
1005 e.value = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
1006 (*CONSTRUCTOR_ELTS (expr))[i] = e;
kono
parents:
diff changeset
1007 }
kono
parents:
diff changeset
1008 }
kono
parents:
diff changeset
1009
kono
parents:
diff changeset
1010
kono
parents:
diff changeset
1011 /* Read all pointer fields in the TS_OMP_CLAUSE structure of EXPR from
kono
parents:
diff changeset
1012 input block IB. DATA_IN contains tables and descriptors for the
kono
parents:
diff changeset
1013 file being read. */
kono
parents:
diff changeset
1014
kono
parents:
diff changeset
1015 static void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1016 lto_input_ts_omp_clause_tree_pointers (class lto_input_block *ib,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1017 class data_in *data_in, tree expr)
111
kono
parents:
diff changeset
1018 {
kono
parents:
diff changeset
1019 int i;
kono
parents:
diff changeset
1020
kono
parents:
diff changeset
1021 for (i = 0; i < omp_clause_num_ops[OMP_CLAUSE_CODE (expr)]; i++)
kono
parents:
diff changeset
1022 OMP_CLAUSE_OPERAND (expr, i) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
1023 OMP_CLAUSE_CHAIN (expr) = stream_read_tree (ib, data_in);
kono
parents:
diff changeset
1024 }
kono
parents:
diff changeset
1025
kono
parents:
diff changeset
1026
kono
parents:
diff changeset
1027 /* Read all pointer fields in EXPR from input block IB. DATA_IN
kono
parents:
diff changeset
1028 contains tables and descriptors for the file being read. */
kono
parents:
diff changeset
1029
kono
parents:
diff changeset
1030 void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1031 streamer_read_tree_body (class lto_input_block *ib, class data_in *data_in,
111
kono
parents:
diff changeset
1032 tree expr)
kono
parents:
diff changeset
1033 {
kono
parents:
diff changeset
1034 enum tree_code code;
kono
parents:
diff changeset
1035
kono
parents:
diff changeset
1036 code = TREE_CODE (expr);
kono
parents:
diff changeset
1037
kono
parents:
diff changeset
1038 if (CODE_CONTAINS_STRUCT (code, TS_TYPED))
kono
parents:
diff changeset
1039 lto_input_ts_common_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1040
kono
parents:
diff changeset
1041 if (CODE_CONTAINS_STRUCT (code, TS_VECTOR))
kono
parents:
diff changeset
1042 lto_input_ts_vector_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1043
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1044 if (CODE_CONTAINS_STRUCT (code, TS_POLY_INT_CST))
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1045 lto_input_ts_poly_tree_pointers (ib, data_in, expr);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1046
111
kono
parents:
diff changeset
1047 if (CODE_CONTAINS_STRUCT (code, TS_COMPLEX))
kono
parents:
diff changeset
1048 lto_input_ts_complex_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1049
kono
parents:
diff changeset
1050 if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
kono
parents:
diff changeset
1051 lto_input_ts_decl_minimal_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1052
kono
parents:
diff changeset
1053 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
kono
parents:
diff changeset
1054 lto_input_ts_decl_common_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1055
kono
parents:
diff changeset
1056 if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
kono
parents:
diff changeset
1057 lto_input_ts_decl_non_common_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1058
kono
parents:
diff changeset
1059 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
kono
parents:
diff changeset
1060 lto_input_ts_decl_with_vis_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1061
kono
parents:
diff changeset
1062 if (CODE_CONTAINS_STRUCT (code, TS_FIELD_DECL))
kono
parents:
diff changeset
1063 lto_input_ts_field_decl_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1064
kono
parents:
diff changeset
1065 if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
kono
parents:
diff changeset
1066 lto_input_ts_function_decl_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1067
kono
parents:
diff changeset
1068 if (CODE_CONTAINS_STRUCT (code, TS_TYPE_COMMON))
kono
parents:
diff changeset
1069 lto_input_ts_type_common_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1070
kono
parents:
diff changeset
1071 if (CODE_CONTAINS_STRUCT (code, TS_TYPE_NON_COMMON))
kono
parents:
diff changeset
1072 lto_input_ts_type_non_common_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1073
kono
parents:
diff changeset
1074 if (CODE_CONTAINS_STRUCT (code, TS_LIST))
kono
parents:
diff changeset
1075 lto_input_ts_list_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1076
kono
parents:
diff changeset
1077 if (CODE_CONTAINS_STRUCT (code, TS_VEC))
kono
parents:
diff changeset
1078 lto_input_ts_vec_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1079
kono
parents:
diff changeset
1080 if (CODE_CONTAINS_STRUCT (code, TS_EXP))
kono
parents:
diff changeset
1081 lto_input_ts_exp_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1082
kono
parents:
diff changeset
1083 if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
kono
parents:
diff changeset
1084 lto_input_ts_block_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1085
kono
parents:
diff changeset
1086 if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
kono
parents:
diff changeset
1087 lto_input_ts_binfo_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1088
kono
parents:
diff changeset
1089 if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
kono
parents:
diff changeset
1090 lto_input_ts_constructor_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1091
kono
parents:
diff changeset
1092 if (code == OMP_CLAUSE)
kono
parents:
diff changeset
1093 lto_input_ts_omp_clause_tree_pointers (ib, data_in, expr);
kono
parents:
diff changeset
1094 }
kono
parents:
diff changeset
1095
kono
parents:
diff changeset
1096
kono
parents:
diff changeset
1097 /* Read an index IX from input block IB and return the tree node at
kono
parents:
diff changeset
1098 DATA_IN->FILE_DATA->GLOBALS_INDEX[IX]. */
kono
parents:
diff changeset
1099
kono
parents:
diff changeset
1100 tree
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1101 streamer_get_pickled_tree (class lto_input_block *ib, class data_in *data_in)
111
kono
parents:
diff changeset
1102 {
kono
parents:
diff changeset
1103 unsigned HOST_WIDE_INT ix;
kono
parents:
diff changeset
1104 tree result;
kono
parents:
diff changeset
1105 enum LTO_tags expected_tag;
kono
parents:
diff changeset
1106
kono
parents:
diff changeset
1107 ix = streamer_read_uhwi (ib);
kono
parents:
diff changeset
1108 expected_tag = streamer_read_enum (ib, LTO_tags, LTO_NUM_TAGS);
kono
parents:
diff changeset
1109
kono
parents:
diff changeset
1110 result = streamer_tree_cache_get_tree (data_in->reader_cache, ix);
kono
parents:
diff changeset
1111 gcc_assert (result
kono
parents:
diff changeset
1112 && TREE_CODE (result) == lto_tag_to_tree_code (expected_tag));
kono
parents:
diff changeset
1113
kono
parents:
diff changeset
1114 return result;
kono
parents:
diff changeset
1115 }