Mercurial > hg > CbC > CbC_gcc
annotate gcc/lto-streamer-in.c @ 127:4c56639505ff
fix function.c and add CbC-example Makefile
author | mir3636 |
---|---|
date | Wed, 11 Apr 2018 18:46:58 +0900 |
parents | 04ced10e8804 |
children | 84e7813d76e9 |
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 /* Read the GIMPLE representation from a file stream. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
111 | 3 Copyright (C) 2009-2017 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
|
4 Contributed by Kenneth Zadeck <zadeck@naturalbridge.com> |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 Re-implemented by Diego Novillo <dnovillo@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 #include "config.h" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 #include "system.h" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 #include "coretypes.h" |
111 | 26 #include "backend.h" |
27 #include "target.h" | |
28 #include "rtl.h" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 #include "tree.h" |
111 | 30 #include "gimple.h" |
31 #include "cfghooks.h" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 #include "tree-pass.h" |
111 | 33 #include "ssa.h" |
34 #include "gimple-streamer.h" | |
35 #include "toplev.h" | |
36 #include "gimple-iterator.h" | |
37 #include "tree-cfg.h" | |
38 #include "tree-into-ssa.h" | |
39 #include "tree-dfa.h" | |
40 #include "tree-ssa.h" | |
41 #include "except.h" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 #include "cgraph.h" |
111 | 43 #include "cfgloop.h" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 #include "debug.h" |
111 | 45 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 |
111 | 47 struct freeing_string_slot_hasher : string_slot_hasher |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 { |
111 | 49 static inline void remove (value_type *); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 }; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 |
111 | 52 inline void |
53 freeing_string_slot_hasher::remove (value_type *v) | |
54 { | |
55 free (v); | |
56 } | |
57 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 /* The table to hold the file names. */ |
111 | 59 static hash_table<freeing_string_slot_hasher> *file_name_hash_table; |
55
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 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 /* Check that tag ACTUAL has one of the given values. NUM_TAGS is the |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 number of valid tag values to check. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 |
111 | 65 void |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 lto_tag_check_set (enum LTO_tags actual, int ntags, ...) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 va_list ap; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 int i; |
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 va_start (ap, ntags); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 for (i = 0; i < ntags; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 if ((unsigned) actual == va_arg (ap, unsigned)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 va_end (ap); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 return; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 va_end (ap); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 internal_error ("bytecode stream: unexpected tag %s", lto_tag_name (actual)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 } |
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 |
111 | 84 /* Read LENGTH bytes from STREAM to ADDR. */ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 |
111 | 86 void |
87 lto_input_data_block (struct lto_input_block *ib, void *addr, size_t length) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 { |
111 | 89 size_t i; |
90 unsigned char *const buffer = (unsigned char *) addr; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 |
111 | 92 for (i = 0; i < length; i++) |
93 buffer[i] = streamer_read_uchar (ib); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 } |
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 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 /* Lookup STRING in file_name_hash_table. If found, return the existing |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 string, otherwise insert STRING as the canonical version. */ |
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 static const char * |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 canon_file_name (const char *string) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 { |
111 | 103 string_slot **slot; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 struct string_slot s_slot; |
111 | 105 size_t len = strlen (string); |
106 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 s_slot.s = string; |
111 | 108 s_slot.len = len; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 |
111 | 110 slot = file_name_hash_table->find_slot (&s_slot, INSERT); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 if (*slot == NULL) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 char *saved_string; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 struct string_slot *new_slot; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 saved_string = (char *) xmalloc (len + 1); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 new_slot = XCNEW (struct string_slot); |
111 | 118 memcpy (saved_string, string, len + 1); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 new_slot->s = saved_string; |
111 | 120 new_slot->len = len; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 *slot = new_slot; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 return saved_string; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 { |
111 | 126 struct string_slot *old_slot = *slot; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 return old_slot->s; |
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 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 |
111 | 131 /* Pointer to currently alive instance of lto_location_cache. */ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 |
111 | 133 lto_location_cache *lto_location_cache::current_cache; |
134 | |
135 /* Sort locations in source order. Start with file from last application. */ | |
136 | |
137 int | |
138 lto_location_cache::cmp_loc (const void *pa, const void *pb) | |
139 { | |
140 const cached_location *a = ((const cached_location *)pa); | |
141 const cached_location *b = ((const cached_location *)pb); | |
142 const char *current_file = current_cache->current_file; | |
143 int current_line = current_cache->current_line; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 |
111 | 145 if (a->file == current_file && b->file != current_file) |
146 return -1; | |
147 if (a->file != current_file && b->file == current_file) | |
148 return 1; | |
149 if (a->file == current_file && b->file == current_file) | |
150 { | |
151 if (a->line == current_line && b->line != current_line) | |
152 return -1; | |
153 if (a->line != current_line && b->line == current_line) | |
154 return 1; | |
155 } | |
156 if (a->file != b->file) | |
157 return strcmp (a->file, b->file); | |
158 if (a->sysp != b->sysp) | |
159 return a->sysp ? 1 : -1; | |
160 if (a->line != b->line) | |
161 return a->line - b->line; | |
162 return a->col - b->col; | |
163 } | |
164 | |
165 /* Apply all changes in location cache. Add locations into linemap and patch | |
166 trees. */ | |
167 | |
168 bool | |
169 lto_location_cache::apply_location_cache () | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 { |
111 | 171 static const char *prev_file; |
172 if (!loc_cache.length ()) | |
173 return false; | |
174 if (loc_cache.length () > 1) | |
175 loc_cache.qsort (cmp_loc); | |
176 | |
177 for (unsigned int i = 0; i < loc_cache.length (); i++) | |
178 { | |
179 struct cached_location loc = loc_cache[i]; | |
180 | |
181 if (current_file != loc.file) | |
182 linemap_add (line_table, prev_file ? LC_RENAME : LC_ENTER, | |
183 loc.sysp, loc.file, loc.line); | |
184 else if (current_line != loc.line) | |
185 { | |
186 int max = loc.col; | |
187 | |
188 for (unsigned int j = i + 1; j < loc_cache.length (); j++) | |
189 if (loc.file != loc_cache[j].file | |
190 || loc.line != loc_cache[j].line) | |
191 break; | |
192 else if (max < loc_cache[j].col) | |
193 max = loc_cache[j].col; | |
194 linemap_line_start (line_table, loc.line, max + 1); | |
195 } | |
196 gcc_assert (*loc.loc == BUILTINS_LOCATION + 1); | |
197 if (current_file == loc.file && current_line == loc.line | |
198 && current_col == loc.col) | |
199 *loc.loc = current_loc; | |
200 else | |
201 current_loc = *loc.loc = linemap_position_for_column (line_table, | |
202 loc.col); | |
203 current_line = loc.line; | |
204 prev_file = current_file = loc.file; | |
205 current_col = loc.col; | |
206 } | |
207 loc_cache.truncate (0); | |
208 accepted_length = 0; | |
209 return true; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 |
111 | 212 /* Tree merging did not suceed; mark all changes in the cache as accepted. */ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 |
111 | 214 void |
215 lto_location_cache::accept_location_cache () | |
216 { | |
217 gcc_assert (current_cache == this); | |
218 accepted_length = loc_cache.length (); | |
219 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 |
111 | 221 /* Tree merging did suceed; throw away recent changes. */ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
222 |
111 | 223 void |
224 lto_location_cache::revert_location_cache () | |
225 { | |
226 loc_cache.truncate (accepted_length); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 |
111 | 229 /* Read a location bitpack from input block IB and either update *LOC directly |
230 or add it to the location cache. | |
231 It is neccesary to call apply_location_cache to get *LOC updated. */ | |
232 | |
233 void | |
234 lto_location_cache::input_location (location_t *loc, struct bitpack_d *bp, | |
235 struct data_in *data_in) | |
236 { | |
237 static const char *stream_file; | |
238 static int stream_line; | |
239 static int stream_col; | |
240 static bool stream_sysp; | |
241 bool file_change, line_change, column_change; | |
242 | |
243 gcc_assert (current_cache == this); | |
244 | |
245 *loc = bp_unpack_int_in_range (bp, "location", 0, RESERVED_LOCATION_COUNT); | |
246 | |
247 if (*loc < RESERVED_LOCATION_COUNT) | |
248 return; | |
249 | |
250 /* Keep value RESERVED_LOCATION_COUNT in *loc as linemap lookups will | |
251 ICE on it. */ | |
252 | |
253 file_change = bp_unpack_value (bp, 1); | |
254 line_change = bp_unpack_value (bp, 1); | |
255 column_change = bp_unpack_value (bp, 1); | |
256 | |
257 if (file_change) | |
258 { | |
259 stream_file = canon_file_name (bp_unpack_string (data_in, bp)); | |
260 stream_sysp = bp_unpack_value (bp, 1); | |
261 } | |
262 | |
263 if (line_change) | |
264 stream_line = bp_unpack_var_len_unsigned (bp); | |
265 | |
266 if (column_change) | |
267 stream_col = bp_unpack_var_len_unsigned (bp); | |
268 | |
269 /* This optimization saves location cache operations druing gimple | |
270 streaming. */ | |
271 | |
272 if (current_file == stream_file && current_line == stream_line | |
273 && current_col == stream_col && current_sysp == stream_sysp) | |
274 { | |
275 *loc = current_loc; | |
276 return; | |
277 } | |
278 | |
279 struct cached_location entry | |
280 = {stream_file, loc, stream_line, stream_col, stream_sysp}; | |
281 loc_cache.safe_push (entry); | |
282 } | |
283 | |
284 /* Read a location bitpack from input block IB and either update *LOC directly | |
285 or add it to the location cache. | |
286 It is neccesary to call apply_location_cache to get *LOC updated. */ | |
287 | |
288 void | |
289 lto_input_location (location_t *loc, struct bitpack_d *bp, | |
290 struct data_in *data_in) | |
291 { | |
292 data_in->location_cache.input_location (loc, bp, data_in); | |
293 } | |
294 | |
295 /* Read location and return it instead of going through location caching. | |
296 This should be used only when the resulting location is not going to be | |
297 discarded. */ | |
298 | |
299 location_t | |
300 stream_input_location_now (struct bitpack_d *bp, struct data_in *data_in) | |
301 { | |
302 location_t loc; | |
303 stream_input_location (&loc, bp, data_in); | |
304 data_in->location_cache.apply_location_cache (); | |
305 return loc; | |
306 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
307 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
308 /* Read a reference to a tree node from DATA_IN using input block IB. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
309 TAG is the expected node that should be found in IB, if TAG belongs |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
310 to one of the indexable trees, expect to read a reference index to |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
311 be looked up in one of the symbol tables, otherwise read the pysical |
111 | 312 representation of the tree using stream_read_tree. FN is the |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
313 function scope for the read tree. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
314 |
111 | 315 tree |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
316 lto_input_tree_ref (struct lto_input_block *ib, struct data_in *data_in, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
317 struct function *fn, 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
|
318 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
319 unsigned HOST_WIDE_INT ix_u; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
320 tree result = NULL_TREE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
321 |
111 | 322 lto_tag_check_range (tag, LTO_field_decl_ref, LTO_namelist_decl_ref); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
323 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
324 switch (tag) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
325 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
326 case LTO_type_ref: |
111 | 327 ix_u = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
328 result = lto_file_decl_data_get_type (data_in->file_data, ix_u); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
329 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
330 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
331 case LTO_ssa_name_ref: |
111 | 332 ix_u = streamer_read_uhwi (ib); |
333 result = (*SSANAMES (fn))[ix_u]; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
334 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
335 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
336 case LTO_field_decl_ref: |
111 | 337 ix_u = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
338 result = lto_file_decl_data_get_field_decl (data_in->file_data, ix_u); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
339 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
340 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
341 case LTO_function_decl_ref: |
111 | 342 ix_u = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
343 result = lto_file_decl_data_get_fn_decl (data_in->file_data, ix_u); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
344 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
345 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
346 case LTO_type_decl_ref: |
111 | 347 ix_u = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
348 result = lto_file_decl_data_get_type_decl (data_in->file_data, ix_u); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
349 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
350 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
351 case LTO_namespace_decl_ref: |
111 | 352 ix_u = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
353 result = lto_file_decl_data_get_namespace_decl (data_in->file_data, ix_u); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
354 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
355 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
356 case LTO_global_decl_ref: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
357 case 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
|
358 case 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
|
359 case LTO_imported_decl_ref: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
360 case LTO_label_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
|
361 case LTO_translation_unit_decl_ref: |
111 | 362 case LTO_namelist_decl_ref: |
363 ix_u = streamer_read_uhwi (ib); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
364 result = lto_file_decl_data_get_var_decl (data_in->file_data, ix_u); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
365 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
366 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
367 default: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
368 gcc_unreachable (); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
369 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
370 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
371 gcc_assert (result); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
372 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
373 return result; |
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 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
376 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
377 /* Read and return a double-linked list of catch handlers from input |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
378 block IB, using descriptors in DATA_IN. */ |
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 static struct eh_catch_d * |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
381 lto_input_eh_catch_list (struct lto_input_block *ib, struct data_in *data_in, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
382 eh_catch *last_p) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
383 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
384 eh_catch first; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
385 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
|
386 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
387 *last_p = first = NULL; |
111 | 388 tag = streamer_read_record_start (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
389 while (tag) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
390 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
391 tree list; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
392 eh_catch n; |
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 lto_tag_check_range (tag, LTO_eh_catch, LTO_eh_catch); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
395 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
396 /* Read the catch node. */ |
111 | 397 n = ggc_cleared_alloc<eh_catch_d> (); |
398 n->type_list = stream_read_tree (ib, data_in); | |
399 n->filter_list = stream_read_tree (ib, data_in); | |
400 n->label = stream_read_tree (ib, data_in); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
401 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
402 /* Register all the types in N->FILTER_LIST. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
403 for (list = n->filter_list; list; list = TREE_CHAIN (list)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
404 add_type_for_runtime (TREE_VALUE (list)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
405 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
406 /* Chain N to the end of the list. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
407 if (*last_p) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
408 (*last_p)->next_catch = n; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
409 n->prev_catch = *last_p; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
410 *last_p = n; |
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 /* Set the head of the list the first time through the loop. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
413 if (first == NULL) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
414 first = n; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
415 |
111 | 416 tag = streamer_read_record_start (ib); |
55
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 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
419 return first; |
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 /* Read and return EH region IX from input block IB, using descriptors |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
424 in DATA_IN. */ |
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 static eh_region |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
427 input_eh_region (struct lto_input_block *ib, struct data_in *data_in, int ix) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
428 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
429 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
|
430 eh_region r; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
431 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
432 /* Read the region header. */ |
111 | 433 tag = streamer_read_record_start (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
434 if (tag == LTO_null) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
435 return NULL; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
436 |
111 | 437 r = ggc_cleared_alloc<eh_region_d> (); |
438 r->index = streamer_read_hwi (ib); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
439 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
440 gcc_assert (r->index == ix); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
441 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
442 /* Read all the region pointers as region numbers. We'll fix up |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
443 the pointers once the whole array has been read. */ |
111 | 444 r->outer = (eh_region) (intptr_t) streamer_read_hwi (ib); |
445 r->inner = (eh_region) (intptr_t) streamer_read_hwi (ib); | |
446 r->next_peer = (eh_region) (intptr_t) streamer_read_hwi (ib); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
447 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
448 switch (tag) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
449 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
450 case LTO_ert_cleanup: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
451 r->type = ERT_CLEANUP; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
452 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
453 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
454 case LTO_ert_try: |
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 struct eh_catch_d *last_catch; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
457 r->type = ERT_TRY; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
458 r->u.eh_try.first_catch = lto_input_eh_catch_list (ib, data_in, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
459 &last_catch); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
460 r->u.eh_try.last_catch = last_catch; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
461 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
462 } |
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 case 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
|
465 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
466 tree l; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
467 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
468 r->type = ERT_ALLOWED_EXCEPTIONS; |
111 | 469 r->u.allowed.type_list = stream_read_tree (ib, data_in); |
470 r->u.allowed.label = stream_read_tree (ib, data_in); | |
471 r->u.allowed.filter = streamer_read_uhwi (ib); | |
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 for (l = r->u.allowed.type_list; l ; l = TREE_CHAIN (l)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
474 add_type_for_runtime (TREE_VALUE (l)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
475 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
476 break; |
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 case LTO_ert_must_not_throw: |
111 | 479 { |
480 r->type = ERT_MUST_NOT_THROW; | |
481 r->u.must_not_throw.failure_decl = stream_read_tree (ib, data_in); | |
482 bitpack_d bp = streamer_read_bitpack (ib); | |
483 r->u.must_not_throw.failure_loc | |
484 = stream_input_location_now (&bp, data_in); | |
485 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
486 break; |
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 default: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
489 gcc_unreachable (); |
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 |
111 | 492 r->landing_pads = (eh_landing_pad) (intptr_t) streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
493 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
494 return r; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
495 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
496 |
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 /* Read and return EH landing pad IX from input block IB, using descriptors |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
499 in DATA_IN. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
500 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
501 static eh_landing_pad |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
502 input_eh_lp (struct lto_input_block *ib, struct data_in *data_in, int ix) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
503 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
504 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
|
505 eh_landing_pad lp; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
506 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
507 /* Read the landing pad header. */ |
111 | 508 tag = streamer_read_record_start (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
509 if (tag == LTO_null) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
510 return NULL; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
511 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
512 lto_tag_check_range (tag, LTO_eh_landing_pad, 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
|
513 |
111 | 514 lp = ggc_cleared_alloc<eh_landing_pad_d> (); |
515 lp->index = streamer_read_hwi (ib); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
516 gcc_assert (lp->index == ix); |
111 | 517 lp->next_lp = (eh_landing_pad) (intptr_t) streamer_read_hwi (ib); |
518 lp->region = (eh_region) (intptr_t) streamer_read_hwi (ib); | |
519 lp->post_landing_pad = stream_read_tree (ib, data_in); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
520 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
521 return lp; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
522 } |
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 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
525 /* After reading the EH regions, pointers to peer and children regions |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
526 are region numbers. This converts all these region numbers into |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
527 real pointers into the rematerialized regions for FN. ROOT_REGION |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
528 is the region number for the root EH region in FN. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
529 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
530 static void |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
531 fixup_eh_region_pointers (struct function *fn, HOST_WIDE_INT root_region) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
532 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
533 unsigned i; |
111 | 534 vec<eh_region, va_gc> *eh_array = fn->eh->region_array; |
535 vec<eh_landing_pad, va_gc> *lp_array = fn->eh->lp_array; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
536 eh_region r; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
537 eh_landing_pad lp; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
538 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
539 gcc_assert (eh_array && lp_array); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
540 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
541 gcc_assert (root_region >= 0); |
111 | 542 fn->eh->region_tree = (*eh_array)[root_region]; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
543 |
111 | 544 #define FIXUP_EH_REGION(r) (r) = (*eh_array)[(HOST_WIDE_INT) (intptr_t) (r)] |
545 #define FIXUP_EH_LP(p) (p) = (*lp_array)[(HOST_WIDE_INT) (intptr_t) (p)] | |
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 /* Convert all the index numbers stored in pointer fields into |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
548 pointers to the corresponding slots in the EH region array. */ |
111 | 549 FOR_EACH_VEC_ELT (*eh_array, i, r) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
550 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
551 /* The array may contain NULL regions. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
552 if (r == NULL) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
553 continue; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
554 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
555 gcc_assert (i == (unsigned) r->index); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
556 FIXUP_EH_REGION (r->outer); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
557 FIXUP_EH_REGION (r->inner); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
558 FIXUP_EH_REGION (r->next_peer); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
559 FIXUP_EH_LP (r->landing_pads); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
560 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
561 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
562 /* Convert all the index numbers stored in pointer fields into |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
563 pointers to the corresponding slots in the EH landing pad array. */ |
111 | 564 FOR_EACH_VEC_ELT (*lp_array, i, lp) |
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 array may contain NULL landing pads. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
567 if (lp == NULL) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
568 continue; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
569 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
570 gcc_assert (i == (unsigned) lp->index); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
571 FIXUP_EH_LP (lp->next_lp); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
572 FIXUP_EH_REGION (lp->region); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
573 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
574 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
575 #undef FIXUP_EH_REGION |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
576 #undef FIXUP_EH_LP |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
577 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
578 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
579 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
580 /* Initialize EH support. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
581 |
111 | 582 void |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
583 lto_init_eh (void) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
584 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
585 static bool eh_initialized_p = false; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
586 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
587 if (eh_initialized_p) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
588 return; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
589 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
590 /* Contrary to most other FEs, we only initialize EH support when at |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
591 least one of the files in the set contains exception regions in |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
592 it. Since this happens much later than the call to init_eh in |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
593 lang_dependent_init, we have to set flag_exceptions and call |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
594 init_eh again to initialize the EH tables. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
595 flag_exceptions = 1; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
596 init_eh (); |
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 eh_initialized_p = true; |
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 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
602 /* Read the exception table for FN from IB using the data descriptors |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
603 in DATA_IN. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
604 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
605 static void |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
606 input_eh_regions (struct lto_input_block *ib, struct data_in *data_in, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
607 struct function *fn) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
608 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
609 HOST_WIDE_INT i, root_region, len; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
610 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
|
611 |
111 | 612 tag = streamer_read_record_start (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
613 if (tag == LTO_null) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
614 return; |
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 lto_tag_check_range (tag, LTO_eh_table, LTO_eh_table); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
617 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
618 /* If the file contains EH regions, then it was compiled with |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
619 -fexceptions. In that case, initialize the backend EH |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
620 machinery. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
621 lto_init_eh (); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
622 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
623 gcc_assert (fn->eh); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
624 |
111 | 625 root_region = streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
626 gcc_assert (root_region == (int) root_region); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
627 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
628 /* Read the EH region array. */ |
111 | 629 len = streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
630 gcc_assert (len == (int) len); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
631 if (len > 0) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
632 { |
111 | 633 vec_safe_grow_cleared (fn->eh->region_array, len); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
634 for (i = 0; i < len; i++) |
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 eh_region r = input_eh_region (ib, data_in, i); |
111 | 637 (*fn->eh->region_array)[i] = r; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
638 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
639 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
640 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
641 /* Read the landing pads. */ |
111 | 642 len = streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
643 gcc_assert (len == (int) len); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
644 if (len > 0) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
645 { |
111 | 646 vec_safe_grow_cleared (fn->eh->lp_array, len); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
647 for (i = 0; i < len; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
648 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
649 eh_landing_pad lp = input_eh_lp (ib, data_in, i); |
111 | 650 (*fn->eh->lp_array)[i] = lp; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
651 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
652 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
653 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
654 /* Read the runtime type data. */ |
111 | 655 len = streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
656 gcc_assert (len == (int) len); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
657 if (len > 0) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
658 { |
111 | 659 vec_safe_grow_cleared (fn->eh->ttype_data, len); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
660 for (i = 0; i < len; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
661 { |
111 | 662 tree ttype = stream_read_tree (ib, data_in); |
663 (*fn->eh->ttype_data)[i] = ttype; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
664 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
665 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
666 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
667 /* Read the table of action chains. */ |
111 | 668 len = streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
669 gcc_assert (len == (int) len); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
670 if (len > 0) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
671 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
672 if (targetm.arm_eabi_unwinder) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
673 { |
111 | 674 vec_safe_grow_cleared (fn->eh->ehspec_data.arm_eabi, len); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
675 for (i = 0; i < len; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
676 { |
111 | 677 tree t = stream_read_tree (ib, data_in); |
678 (*fn->eh->ehspec_data.arm_eabi)[i] = t; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
679 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
680 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
681 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
682 { |
111 | 683 vec_safe_grow_cleared (fn->eh->ehspec_data.other, len); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
684 for (i = 0; i < len; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
685 { |
111 | 686 uchar c = streamer_read_uchar (ib); |
687 (*fn->eh->ehspec_data.other)[i] = c; | |
55
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 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
690 } |
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 /* Reconstruct the EH region tree by fixing up the peer/children |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
693 pointers. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
694 fixup_eh_region_pointers (fn, root_region); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
695 |
111 | 696 tag = streamer_read_record_start (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
697 lto_tag_check_range (tag, LTO_null, LTO_null); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
698 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
699 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
700 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
701 /* Make a new basic block with index INDEX in function FN. */ |
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 static basic_block |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
704 make_new_block (struct function *fn, unsigned int index) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
705 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
706 basic_block bb = alloc_block (); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
707 bb->index = index; |
111 | 708 SET_BASIC_BLOCK_FOR_FN (fn, index, bb); |
709 n_basic_blocks_for_fn (fn)++; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
710 return bb; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
711 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
712 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
713 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
714 /* Read the CFG for function FN from input block IB. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
715 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
716 static void |
111 | 717 input_cfg (struct lto_input_block *ib, struct data_in *data_in, |
718 struct function *fn) | |
55
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 unsigned int bb_count; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
721 basic_block p_bb; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
722 unsigned int i; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
723 int index; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
724 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
725 init_empty_tree_cfg_for_function (fn); |
111 | 726 init_ssa_operands (fn); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
727 |
111 | 728 profile_status_for_fn (fn) = streamer_read_enum (ib, profile_status_d, |
729 PROFILE_LAST); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
730 |
111 | 731 bb_count = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
732 |
111 | 733 last_basic_block_for_fn (fn) = bb_count; |
734 if (bb_count > basic_block_info_for_fn (fn)->length ()) | |
735 vec_safe_grow_cleared (basic_block_info_for_fn (fn), bb_count); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
736 |
111 | 737 if (bb_count > label_to_block_map_for_fn (fn)->length ()) |
738 vec_safe_grow_cleared (label_to_block_map_for_fn (fn), bb_count); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
739 |
111 | 740 index = streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
741 while (index != -1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
742 { |
111 | 743 basic_block bb = BASIC_BLOCK_FOR_FN (fn, index); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
744 unsigned int edge_count; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
745 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
746 if (bb == NULL) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
747 bb = make_new_block (fn, index); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
748 |
111 | 749 edge_count = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
750 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
751 /* Connect up the CFG. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
752 for (i = 0; i < edge_count; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
753 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
754 unsigned int dest_index; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
755 unsigned int edge_flags; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
756 basic_block dest; |
111 | 757 profile_probability probability; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
758 edge e; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
759 |
111 | 760 dest_index = streamer_read_uhwi (ib); |
761 probability = profile_probability::stream_in (ib); | |
762 edge_flags = streamer_read_uhwi (ib); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
763 |
111 | 764 dest = BASIC_BLOCK_FOR_FN (fn, dest_index); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
765 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
766 if (dest == NULL) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
767 dest = make_new_block (fn, dest_index); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
768 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
769 e = make_edge (bb, dest, edge_flags); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
770 e->probability = probability; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
771 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
772 |
111 | 773 index = streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
774 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
775 |
111 | 776 p_bb = ENTRY_BLOCK_PTR_FOR_FN (fn); |
777 index = streamer_read_hwi (ib); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
778 while (index != -1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
779 { |
111 | 780 basic_block bb = BASIC_BLOCK_FOR_FN (fn, index); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
781 bb->prev_bb = p_bb; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
782 p_bb->next_bb = bb; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
783 p_bb = bb; |
111 | 784 index = streamer_read_hwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
785 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
786 |
111 | 787 /* ??? The cfgloop interface is tied to cfun. */ |
788 gcc_assert (cfun == fn); | |
789 | |
790 /* Input the loop tree. */ | |
791 unsigned n_loops = streamer_read_uhwi (ib); | |
792 if (n_loops == 0) | |
793 return; | |
794 | |
795 struct loops *loops = ggc_cleared_alloc<struct loops> (); | |
796 init_loops_structure (fn, loops, n_loops); | |
797 set_loops_for_fn (fn, loops); | |
798 | |
799 /* Input each loop and associate it with its loop header so | |
800 flow_loops_find can rebuild the loop tree. */ | |
801 for (unsigned i = 1; i < n_loops; ++i) | |
802 { | |
803 int header_index = streamer_read_hwi (ib); | |
804 if (header_index == -1) | |
805 { | |
806 loops->larray->quick_push (NULL); | |
807 continue; | |
808 } | |
809 | |
810 struct loop *loop = alloc_loop (); | |
811 loop->header = BASIC_BLOCK_FOR_FN (fn, header_index); | |
812 loop->header->loop_father = loop; | |
813 | |
814 /* Read everything copy_loop_info copies. */ | |
815 loop->estimate_state = streamer_read_enum (ib, loop_estimation, EST_LAST); | |
816 loop->any_upper_bound = streamer_read_hwi (ib); | |
817 if (loop->any_upper_bound) | |
818 loop->nb_iterations_upper_bound = streamer_read_widest_int (ib); | |
819 loop->any_likely_upper_bound = streamer_read_hwi (ib); | |
820 if (loop->any_likely_upper_bound) | |
821 loop->nb_iterations_likely_upper_bound = streamer_read_widest_int (ib); | |
822 loop->any_estimate = streamer_read_hwi (ib); | |
823 if (loop->any_estimate) | |
824 loop->nb_iterations_estimate = streamer_read_widest_int (ib); | |
825 | |
826 /* Read OMP SIMD related info. */ | |
827 loop->safelen = streamer_read_hwi (ib); | |
828 loop->dont_vectorize = streamer_read_hwi (ib); | |
829 loop->force_vectorize = streamer_read_hwi (ib); | |
830 loop->simduid = stream_read_tree (ib, data_in); | |
831 | |
832 place_new_loop (fn, loop); | |
833 | |
834 /* flow_loops_find doesn't like loops not in the tree, hook them | |
835 all as siblings of the tree root temporarily. */ | |
836 flow_loop_tree_node_add (loops->tree_root, loop); | |
837 } | |
838 | |
839 /* Rebuild the loop tree. */ | |
840 flow_loops_find (loops); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
841 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
842 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
843 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
844 /* Read the SSA names array for function FN from DATA_IN using input |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
845 block IB. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
846 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
847 static void |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
848 input_ssa_names (struct lto_input_block *ib, struct data_in *data_in, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
849 struct function *fn) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
850 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
851 unsigned int i, size; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
852 |
111 | 853 size = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
854 init_ssanames (fn, size); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
855 |
111 | 856 i = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
857 while (i) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
858 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
859 tree ssa_name, name; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
860 bool is_default_def; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
861 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
862 /* Skip over the elements that had been freed. */ |
111 | 863 while (SSANAMES (fn)->length () < i) |
864 SSANAMES (fn)->quick_push (NULL_TREE); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
865 |
111 | 866 is_default_def = (streamer_read_uchar (ib) != 0); |
867 name = stream_read_tree (ib, data_in); | |
868 ssa_name = make_ssa_name_fn (fn, name, NULL); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
869 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
870 if (is_default_def) |
111 | 871 { |
872 set_ssa_default_def (cfun, SSA_NAME_VAR (ssa_name), ssa_name); | |
873 SSA_NAME_DEF_STMT (ssa_name) = gimple_build_nop (); | |
874 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
875 |
111 | 876 i = streamer_read_uhwi (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
877 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
878 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
879 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
880 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
881 /* Go through all NODE edges and fixup call_stmt pointers |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
882 so they point to STMTS. */ |
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 static void |
111 | 885 fixup_call_stmt_edges_1 (struct cgraph_node *node, gimple **stmts, |
886 struct function *fn) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
887 { |
111 | 888 #define STMT_UID_NOT_IN_RANGE(uid) \ |
889 (gimple_stmt_max_uid (fn) < uid || uid == 0) | |
890 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
891 struct cgraph_edge *cedge; |
111 | 892 struct ipa_ref *ref = NULL; |
893 unsigned int i; | |
894 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
895 for (cedge = node->callees; cedge; cedge = cedge->next_callee) |
111 | 896 { |
897 if (STMT_UID_NOT_IN_RANGE (cedge->lto_stmt_uid)) | |
898 fatal_error (input_location, | |
899 "Cgraph edge statement index out of range"); | |
900 cedge->call_stmt = as_a <gcall *> (stmts[cedge->lto_stmt_uid - 1]); | |
901 if (!cedge->call_stmt) | |
902 fatal_error (input_location, | |
903 "Cgraph edge statement index not found"); | |
904 } | |
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 for (cedge = node->indirect_calls; cedge; cedge = cedge->next_callee) |
111 | 906 { |
907 if (STMT_UID_NOT_IN_RANGE (cedge->lto_stmt_uid)) | |
908 fatal_error (input_location, | |
909 "Cgraph edge statement index out of range"); | |
910 cedge->call_stmt = as_a <gcall *> (stmts[cedge->lto_stmt_uid - 1]); | |
911 if (!cedge->call_stmt) | |
912 fatal_error (input_location, "Cgraph edge statement index not found"); | |
913 } | |
914 for (i = 0; node->iterate_reference (i, ref); i++) | |
915 if (ref->lto_stmt_uid) | |
916 { | |
917 if (STMT_UID_NOT_IN_RANGE (ref->lto_stmt_uid)) | |
918 fatal_error (input_location, | |
919 "Reference statement index out of range"); | |
920 ref->stmt = stmts[ref->lto_stmt_uid - 1]; | |
921 if (!ref->stmt) | |
922 fatal_error (input_location, "Reference statement index not found"); | |
923 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
924 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
925 |
111 | 926 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
927 /* Fixup call_stmt pointers in NODE and all clones. */ |
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 static void |
111 | 930 fixup_call_stmt_edges (struct cgraph_node *orig, gimple **stmts) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
931 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
932 struct cgraph_node *node; |
111 | 933 struct function *fn; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
934 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
935 while (orig->clone_of) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
936 orig = orig->clone_of; |
111 | 937 fn = DECL_STRUCT_FUNCTION (orig->decl); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
938 |
111 | 939 if (!orig->thunk.thunk_p) |
940 fixup_call_stmt_edges_1 (orig, stmts, fn); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
941 if (orig->clones) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
942 for (node = orig->clones; node != orig;) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
943 { |
111 | 944 if (!node->thunk.thunk_p) |
945 fixup_call_stmt_edges_1 (node, stmts, fn); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
946 if (node->clones) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
947 node = node->clones; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
948 else if (node->next_sibling_clone) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
949 node = node->next_sibling_clone; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
950 else |
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 while (node != orig && !node->next_sibling_clone) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
953 node = node->clone_of; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
954 if (node != orig) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
955 node = node->next_sibling_clone; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
956 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
957 } |
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 |
111 | 960 |
961 /* Input the base body of struct function FN from DATA_IN | |
962 using input block IB. */ | |
963 | |
964 static void | |
965 input_struct_function_base (struct function *fn, struct data_in *data_in, | |
966 struct lto_input_block *ib) | |
967 { | |
968 struct bitpack_d bp; | |
969 int len; | |
970 | |
971 /* Read the static chain and non-local goto save area. */ | |
972 fn->static_chain_decl = stream_read_tree (ib, data_in); | |
973 fn->nonlocal_goto_save_area = stream_read_tree (ib, data_in); | |
974 | |
975 /* Read all the local symbols. */ | |
976 len = streamer_read_hwi (ib); | |
977 if (len > 0) | |
978 { | |
979 int i; | |
980 vec_safe_grow_cleared (fn->local_decls, len); | |
981 for (i = 0; i < len; i++) | |
982 { | |
983 tree t = stream_read_tree (ib, data_in); | |
984 (*fn->local_decls)[i] = t; | |
985 } | |
986 } | |
987 | |
988 /* Input the current IL state of the function. */ | |
989 fn->curr_properties = streamer_read_uhwi (ib); | |
990 | |
991 /* Read all the attributes for FN. */ | |
992 bp = streamer_read_bitpack (ib); | |
993 fn->is_thunk = bp_unpack_value (&bp, 1); | |
994 fn->has_local_explicit_reg_vars = bp_unpack_value (&bp, 1); | |
995 fn->returns_pcc_struct = bp_unpack_value (&bp, 1); | |
996 fn->returns_struct = bp_unpack_value (&bp, 1); | |
997 fn->can_throw_non_call_exceptions = bp_unpack_value (&bp, 1); | |
998 fn->can_delete_dead_exceptions = bp_unpack_value (&bp, 1); | |
999 fn->always_inline_functions_inlined = bp_unpack_value (&bp, 1); | |
1000 fn->after_inlining = bp_unpack_value (&bp, 1); | |
1001 fn->stdarg = bp_unpack_value (&bp, 1); | |
1002 fn->has_nonlocal_label = bp_unpack_value (&bp, 1); | |
1003 fn->has_forced_label_in_static = bp_unpack_value (&bp, 1); | |
1004 fn->calls_alloca = bp_unpack_value (&bp, 1); | |
1005 fn->calls_setjmp = bp_unpack_value (&bp, 1); | |
1006 fn->has_force_vectorize_loops = bp_unpack_value (&bp, 1); | |
1007 fn->has_simduid_loops = bp_unpack_value (&bp, 1); | |
1008 fn->va_list_fpr_size = bp_unpack_value (&bp, 8); | |
1009 fn->va_list_gpr_size = bp_unpack_value (&bp, 8); | |
1010 fn->last_clique = bp_unpack_value (&bp, sizeof (short) * 8); | |
1011 | |
1012 /* Input the function start and end loci. */ | |
1013 fn->function_start_locus = stream_input_location_now (&bp, data_in); | |
1014 fn->function_end_locus = stream_input_location_now (&bp, data_in); | |
1015 } | |
1016 | |
1017 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1018 /* Read the body of function FN_DECL from DATA_IN using input block IB. */ |
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 static void |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1021 input_function (tree fn_decl, struct data_in *data_in, |
111 | 1022 struct lto_input_block *ib, struct lto_input_block *ib_cfg) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1023 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1024 struct function *fn; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1025 enum LTO_tags tag; |
111 | 1026 gimple **stmts; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1027 basic_block bb; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1028 struct cgraph_node *node; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1029 |
111 | 1030 tag = streamer_read_record_start (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1031 lto_tag_check (tag, LTO_function); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1032 |
111 | 1033 /* Read decls for parameters and args. */ |
1034 DECL_RESULT (fn_decl) = stream_read_tree (ib, data_in); | |
1035 DECL_ARGUMENTS (fn_decl) = streamer_read_chain (ib, data_in); | |
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
|
1036 |
111 | 1037 /* Read debug args if available. */ |
1038 unsigned n_debugargs = streamer_read_uhwi (ib); | |
1039 if (n_debugargs) | |
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
|
1040 { |
111 | 1041 vec<tree, va_gc> **debugargs = decl_debug_args_insert (fn_decl); |
1042 vec_safe_grow (*debugargs, n_debugargs); | |
1043 for (unsigned i = 0; i < n_debugargs; ++i) | |
1044 (**debugargs)[i] = stream_read_tree (ib, data_in); | |
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
|
1045 } |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1046 |
111 | 1047 /* Read the tree of lexical scopes for the function. */ |
1048 DECL_INITIAL (fn_decl) = stream_read_tree (ib, data_in); | |
1049 unsigned block_leaf_count = streamer_read_uhwi (ib); | |
1050 while (block_leaf_count--) | |
1051 stream_read_tree (ib, data_in); | |
1052 | |
1053 if (!streamer_read_uhwi (ib)) | |
1054 return; | |
1055 | |
1056 push_struct_function (fn_decl); | |
1057 fn = DECL_STRUCT_FUNCTION (fn_decl); | |
1058 init_tree_ssa (fn); | |
1059 /* We input IL in SSA form. */ | |
1060 cfun->gimple_df->in_ssa_p = true; | |
1061 | |
1062 gimple_register_cfg_hooks (); | |
1063 | |
1064 node = cgraph_node::get (fn_decl); | |
1065 if (!node) | |
1066 node = cgraph_node::create (fn_decl); | |
1067 input_struct_function_base (fn, data_in, ib); | |
1068 input_cfg (ib_cfg, data_in, fn); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1069 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1070 /* Read all the SSA names. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1071 input_ssa_names (ib, data_in, fn); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1072 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1073 /* Read the exception handling regions in the function. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1074 input_eh_regions (ib, data_in, fn); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1075 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1076 gcc_assert (DECL_INITIAL (fn_decl)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1077 DECL_SAVED_TREE (fn_decl) = NULL_TREE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1078 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1079 /* Read all the basic blocks. */ |
111 | 1080 tag = streamer_read_record_start (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1081 while (tag) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1082 { |
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
|
1083 input_bb (ib, tag, data_in, fn, |
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
|
1084 node->count_materialization_scale); |
111 | 1085 tag = streamer_read_record_start (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1086 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1087 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1088 /* Fix up the call statements that are mentioned in the callgraph |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1089 edges. */ |
111 | 1090 set_gimple_stmt_max_uid (cfun, 0); |
1091 FOR_ALL_BB_FN (bb, cfun) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1092 { |
111 | 1093 gimple_stmt_iterator gsi; |
1094 for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) | |
1095 { | |
1096 gimple *stmt = gsi_stmt (gsi); | |
1097 gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun)); | |
1098 } | |
1099 for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) | |
1100 { | |
1101 gimple *stmt = gsi_stmt (gsi); | |
1102 gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun)); | |
1103 } | |
1104 } | |
1105 stmts = (gimple **) xcalloc (gimple_stmt_max_uid (fn), sizeof (gimple *)); | |
1106 FOR_ALL_BB_FN (bb, cfun) | |
1107 { | |
1108 gimple_stmt_iterator bsi = gsi_start_phis (bb); | |
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
|
1109 while (!gsi_end_p (bsi)) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1110 { |
111 | 1111 gimple *stmt = gsi_stmt (bsi); |
1112 gsi_next (&bsi); | |
1113 stmts[gimple_uid (stmt)] = stmt; | |
1114 } | |
1115 bsi = gsi_start_bb (bb); | |
1116 while (!gsi_end_p (bsi)) | |
1117 { | |
1118 gimple *stmt = gsi_stmt (bsi); | |
1119 bool remove = false; | |
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
|
1120 /* If we're recompiling LTO objects with debug stmts but |
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
|
1121 we're not supposed to have debug stmts, remove them now. |
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
|
1122 We can't remove them earlier because this would cause uid |
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
|
1123 mismatches in fixups, but we can do it at this point, as |
111 | 1124 long as debug stmts don't require fixups. |
1125 Similarly remove all IFN_*SAN_* internal calls */ | |
1126 if (!flag_wpa) | |
1127 { | |
1128 if (!MAY_HAVE_DEBUG_STMTS && is_gimple_debug (stmt)) | |
1129 remove = true; | |
1130 if (is_gimple_call (stmt) | |
1131 && gimple_call_internal_p (stmt)) | |
1132 { | |
1133 switch (gimple_call_internal_fn (stmt)) | |
1134 { | |
1135 case IFN_UBSAN_NULL: | |
1136 if ((flag_sanitize | |
1137 & (SANITIZE_NULL | SANITIZE_ALIGNMENT)) == 0) | |
1138 remove = true; | |
1139 break; | |
1140 case IFN_UBSAN_BOUNDS: | |
1141 if ((flag_sanitize & SANITIZE_BOUNDS) == 0) | |
1142 remove = true; | |
1143 break; | |
1144 case IFN_UBSAN_VPTR: | |
1145 if ((flag_sanitize & SANITIZE_VPTR) == 0) | |
1146 remove = true; | |
1147 break; | |
1148 case IFN_UBSAN_OBJECT_SIZE: | |
1149 if ((flag_sanitize & SANITIZE_OBJECT_SIZE) == 0) | |
1150 remove = true; | |
1151 break; | |
1152 case IFN_UBSAN_PTR: | |
1153 if ((flag_sanitize & SANITIZE_POINTER_OVERFLOW) == 0) | |
1154 remove = true; | |
1155 break; | |
1156 case IFN_ASAN_MARK: | |
1157 if ((flag_sanitize & SANITIZE_ADDRESS) == 0) | |
1158 remove = true; | |
1159 break; | |
1160 case IFN_TSAN_FUNC_EXIT: | |
1161 if ((flag_sanitize & SANITIZE_THREAD) == 0) | |
1162 remove = true; | |
1163 break; | |
1164 default: | |
1165 break; | |
1166 } | |
1167 gcc_assert (!remove || gimple_call_lhs (stmt) == NULL_TREE); | |
1168 } | |
1169 } | |
1170 if (remove) | |
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
|
1171 { |
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
|
1172 gimple_stmt_iterator gsi = bsi; |
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
|
1173 gsi_next (&bsi); |
111 | 1174 unlink_stmt_vdef (stmt); |
1175 release_defs (stmt); | |
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
|
1176 gsi_remove (&gsi, true); |
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
|
1177 } |
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
|
1178 else |
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
|
1179 { |
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
|
1180 gsi_next (&bsi); |
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
|
1181 stmts[gimple_uid (stmt)] = stmt; |
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
|
1182 } |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1183 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1184 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1185 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1186 /* Set the gimple body to the statement sequence in the entry |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1187 basic block. FIXME lto, this is fairly hacky. The existence |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1188 of a gimple body is used by the cgraph routines, but we should |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1189 really use the presence of the CFG. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1190 { |
111 | 1191 edge_iterator ei = ei_start (ENTRY_BLOCK_PTR_FOR_FN (cfun)->succs); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1192 gimple_set_body (fn_decl, bb_seq (ei_edge (ei)->dest)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1193 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1194 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1195 fixup_call_stmt_edges (node, stmts); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1196 execute_all_ipa_stmt_fixups (node, stmts); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1197 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1198 update_ssa (TODO_update_ssa_only_virtuals); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1199 free_dominance_info (CDI_DOMINATORS); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1200 free_dominance_info (CDI_POST_DOMINATORS); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1201 free (stmts); |
111 | 1202 pop_cfun (); |
1203 } | |
1204 | |
1205 /* Read the body of function FN_DECL from DATA_IN using input block IB. */ | |
1206 | |
1207 static void | |
1208 input_constructor (tree var, struct data_in *data_in, | |
1209 struct lto_input_block *ib) | |
1210 { | |
1211 DECL_INITIAL (var) = stream_read_tree (ib, data_in); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1212 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1213 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1214 |
111 | 1215 /* Read the body from DATA for function NODE and fill it in. |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1216 FILE_DATA are the global decls and types. SECTION_TYPE is either |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1217 LTO_section_function_body or LTO_section_static_initializer. If |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1218 section type is LTO_section_function_body, FN must be the decl for |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1219 that function. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1220 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1221 static void |
111 | 1222 lto_read_body_or_constructor (struct lto_file_decl_data *file_data, struct symtab_node *node, |
1223 const char *data, enum lto_section_type section_type) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1224 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1225 const struct lto_function_header *header; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1226 struct data_in *data_in; |
111 | 1227 int cfg_offset; |
1228 int main_offset; | |
1229 int string_offset; | |
1230 tree fn_decl = node->decl; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1231 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1232 header = (const struct lto_function_header *) data; |
111 | 1233 if (TREE_CODE (node->decl) == FUNCTION_DECL) |
1234 { | |
1235 cfg_offset = sizeof (struct lto_function_header); | |
1236 main_offset = cfg_offset + header->cfg_size; | |
1237 string_offset = main_offset + header->main_size; | |
1238 } | |
1239 else | |
1240 { | |
1241 main_offset = sizeof (struct lto_function_header); | |
1242 string_offset = main_offset + header->main_size; | |
1243 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1244 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1245 data_in = lto_data_in_create (file_data, data + string_offset, |
111 | 1246 header->string_size, vNULL); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1247 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1248 if (section_type == 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
|
1249 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1250 struct lto_in_decl_state *decl_state; |
111 | 1251 unsigned from; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1252 |
111 | 1253 gcc_checking_assert (node); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1254 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1255 /* Use the function's decl state. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1256 decl_state = lto_get_function_in_decl_state (file_data, fn_decl); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1257 gcc_assert (decl_state); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1258 file_data->current_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
|
1259 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1260 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1261 /* Set up the struct function. */ |
111 | 1262 from = data_in->reader_cache->nodes.length (); |
1263 lto_input_block ib_main (data + main_offset, header->main_size, | |
1264 file_data->mode_table); | |
1265 if (TREE_CODE (node->decl) == FUNCTION_DECL) | |
1266 { | |
1267 lto_input_block ib_cfg (data + cfg_offset, header->cfg_size, | |
1268 file_data->mode_table); | |
1269 input_function (fn_decl, data_in, &ib_main, &ib_cfg); | |
1270 } | |
1271 else | |
1272 input_constructor (fn_decl, data_in, &ib_main); | |
1273 data_in->location_cache.apply_location_cache (); | |
1274 /* And fixup types we streamed locally. */ | |
1275 { | |
1276 struct streamer_tree_cache_d *cache = data_in->reader_cache; | |
1277 unsigned len = cache->nodes.length (); | |
1278 unsigned i; | |
1279 for (i = len; i-- > from;) | |
1280 { | |
1281 tree t = streamer_tree_cache_get_tree (cache, i); | |
1282 if (t == NULL_TREE) | |
1283 continue; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1284 |
111 | 1285 if (TYPE_P (t)) |
1286 { | |
1287 gcc_assert (TYPE_CANONICAL (t) == NULL_TREE); | |
1288 if (type_with_alias_set_p (t) | |
1289 && canonical_type_used_p (t)) | |
1290 TYPE_CANONICAL (t) = TYPE_MAIN_VARIANT (t); | |
1291 if (TYPE_MAIN_VARIANT (t) != t) | |
1292 { | |
1293 gcc_assert (TYPE_NEXT_VARIANT (t) == NULL_TREE); | |
1294 TYPE_NEXT_VARIANT (t) | |
1295 = TYPE_NEXT_VARIANT (TYPE_MAIN_VARIANT (t)); | |
1296 TYPE_NEXT_VARIANT (TYPE_MAIN_VARIANT (t)) = t; | |
1297 } | |
1298 } | |
1299 } | |
1300 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1301 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1302 /* Restore decl state */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1303 file_data->current_decl_state = file_data->global_decl_state; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1304 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1305 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1306 lto_data_in_delete (data_in); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1307 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1308 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1309 |
111 | 1310 /* Read the body of NODE using DATA. FILE_DATA holds the global |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1311 decls and types. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1312 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1313 void |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1314 lto_input_function_body (struct lto_file_decl_data *file_data, |
111 | 1315 struct cgraph_node *node, const char *data) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1316 { |
111 | 1317 lto_read_body_or_constructor (file_data, node, data, LTO_section_function_body); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1318 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1319 |
111 | 1320 /* Read the body of NODE using DATA. FILE_DATA holds the global |
1321 decls and types. */ | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1322 |
111 | 1323 void |
1324 lto_input_variable_constructor (struct lto_file_decl_data *file_data, | |
1325 struct varpool_node *node, const char *data) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1326 { |
111 | 1327 lto_read_body_or_constructor (file_data, node, data, LTO_section_function_body); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1328 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1329 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1330 |
111 | 1331 /* Queue of acummulated decl -> DIE mappings. Similar to locations those |
1332 are only applied to prevailing tree nodes during tree merging. */ | |
1333 vec<dref_entry> dref_queue; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1334 |
111 | 1335 /* Read the physical representation of a tree node EXPR from |
1336 input block IB using the per-file context in DATA_IN. */ | |
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
|
1337 |
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
|
1338 static void |
111 | 1339 lto_read_tree_1 (struct lto_input_block *ib, struct data_in *data_in, tree expr) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1340 { |
111 | 1341 /* Read all the bitfield values in EXPR. Note that for LTO, we |
1342 only write language-independent bitfields, so no more unpacking is | |
1343 needed. */ | |
1344 streamer_read_tree_bitfields (ib, data_in, expr); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1345 |
111 | 1346 /* Read all the pointer fields in EXPR. */ |
1347 streamer_read_tree_body (ib, data_in, expr); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1348 |
111 | 1349 /* Read any LTO-specific data not read by the tree streamer. */ |
1350 if (DECL_P (expr) | |
1351 && TREE_CODE (expr) != FUNCTION_DECL | |
1352 && TREE_CODE (expr) != TRANSLATION_UNIT_DECL) | |
1353 DECL_INITIAL (expr) = stream_read_tree (ib, data_in); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1354 |
111 | 1355 /* Stream references to early generated DIEs. Keep in sync with the |
1356 trees handled in dwarf2out_register_external_die. */ | |
1357 if ((DECL_P (expr) | |
1358 && TREE_CODE (expr) != FIELD_DECL | |
1359 && TREE_CODE (expr) != DEBUG_EXPR_DECL | |
1360 && TREE_CODE (expr) != TYPE_DECL) | |
1361 || TREE_CODE (expr) == BLOCK) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1362 { |
111 | 1363 const char *str = streamer_read_string (data_in, ib); |
1364 if (str) | |
1365 { | |
1366 unsigned HOST_WIDE_INT off = streamer_read_uhwi (ib); | |
1367 dref_entry e = { expr, str, off }; | |
1368 dref_queue.safe_push (e); | |
1369 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1370 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1371 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1372 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1373 /* Read the physical representation of a tree node with tag TAG from |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1374 input block IB using the per-file context in DATA_IN. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1375 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1376 static tree |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1377 lto_read_tree (struct lto_input_block *ib, struct data_in *data_in, |
111 | 1378 enum LTO_tags tag, hashval_t hash) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1379 { |
111 | 1380 /* Instantiate a new tree node. */ |
1381 tree result = streamer_alloc_tree (ib, data_in, tag); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1382 |
111 | 1383 /* Enter RESULT in the reader cache. This will make RESULT |
1384 available so that circular references in the rest of the tree | |
1385 structure can be resolved in subsequent calls to stream_read_tree. */ | |
1386 streamer_tree_cache_append (data_in->reader_cache, result, hash); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1387 |
111 | 1388 lto_read_tree_1 (ib, data_in, result); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1389 |
111 | 1390 /* end_marker = */ streamer_read_uchar (ib); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1391 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1392 return result; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1393 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1394 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1395 |
111 | 1396 /* Populate the reader cache with trees materialized from the SCC |
1397 following in the IB, DATA_IN stream. */ | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1398 |
111 | 1399 hashval_t |
1400 lto_input_scc (struct lto_input_block *ib, struct data_in *data_in, | |
1401 unsigned *len, unsigned *entry_len) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1402 { |
111 | 1403 /* A blob of unnamed tree nodes, fill the cache from it and |
1404 recurse. */ | |
1405 unsigned size = streamer_read_uhwi (ib); | |
1406 hashval_t scc_hash = streamer_read_uhwi (ib); | |
1407 unsigned scc_entry_len = 1; | |
1408 | |
1409 if (size == 1) | |
1410 { | |
1411 enum LTO_tags tag = streamer_read_record_start (ib); | |
1412 lto_input_tree_1 (ib, data_in, tag, scc_hash); | |
1413 } | |
1414 else | |
1415 { | |
1416 unsigned int first = data_in->reader_cache->nodes.length (); | |
1417 tree result; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1418 |
111 | 1419 scc_entry_len = streamer_read_uhwi (ib); |
1420 | |
1421 /* Materialize size trees by reading their headers. */ | |
1422 for (unsigned i = 0; i < size; ++i) | |
1423 { | |
1424 enum LTO_tags tag = streamer_read_record_start (ib); | |
1425 if (tag == LTO_null | |
1426 || (tag >= LTO_field_decl_ref && tag <= LTO_global_decl_ref) | |
1427 || tag == LTO_tree_pickle_reference | |
1428 || tag == LTO_integer_cst | |
1429 || tag == LTO_tree_scc) | |
1430 gcc_unreachable (); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1431 |
111 | 1432 result = streamer_alloc_tree (ib, data_in, tag); |
1433 streamer_tree_cache_append (data_in->reader_cache, result, 0); | |
1434 } | |
1435 | |
1436 /* Read the tree bitpacks and references. */ | |
1437 for (unsigned i = 0; i < size; ++i) | |
1438 { | |
1439 result = streamer_tree_cache_get_tree (data_in->reader_cache, | |
1440 first + i); | |
1441 lto_read_tree_1 (ib, data_in, result); | |
1442 /* end_marker = */ streamer_read_uchar (ib); | |
1443 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1444 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1445 |
111 | 1446 *len = size; |
1447 *entry_len = scc_entry_len; | |
1448 return scc_hash; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1449 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1450 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1451 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1452 /* Read a tree from input block IB using the per-file context in |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1453 DATA_IN. This context is used, for example, to resolve references |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1454 to previously read nodes. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1455 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1456 tree |
111 | 1457 lto_input_tree_1 (struct lto_input_block *ib, struct data_in *data_in, |
1458 enum LTO_tags tag, hashval_t hash) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1459 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1460 tree result; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1461 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1462 gcc_assert ((unsigned) tag < (unsigned) LTO_NUM_TAGS); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1463 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1464 if (tag == LTO_null) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1465 result = NULL_TREE; |
111 | 1466 else if (tag >= LTO_field_decl_ref && tag <= LTO_namelist_decl_ref) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1467 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1468 /* If TAG is a reference to an indexable tree, the next value |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1469 in IB is the index into the table where we expect to find |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1470 that tree. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1471 result = lto_input_tree_ref (ib, data_in, cfun, tag); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1472 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1473 else if (tag == LTO_tree_pickle_reference) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1474 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1475 /* If TAG is a reference to a previously read tree, look it up in |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1476 the reader cache. */ |
111 | 1477 result = streamer_get_pickled_tree (ib, data_in); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1478 } |
111 | 1479 else if (tag == 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
|
1480 { |
111 | 1481 /* For shared integer constants in singletons we can use the |
1482 existing tree integer constant merging code. */ | |
1483 tree type = stream_read_tree (ib, data_in); | |
1484 unsigned HOST_WIDE_INT len = streamer_read_uhwi (ib); | |
1485 unsigned HOST_WIDE_INT i; | |
1486 HOST_WIDE_INT a[WIDE_INT_MAX_ELTS]; | |
1487 | |
1488 for (i = 0; i < len; i++) | |
1489 a[i] = streamer_read_hwi (ib); | |
1490 gcc_assert (TYPE_PRECISION (type) <= MAX_BITSIZE_MODE_ANY_INT); | |
1491 result = wide_int_to_tree (type, wide_int::from_array | |
1492 (a, len, TYPE_PRECISION (type))); | |
1493 streamer_tree_cache_append (data_in->reader_cache, result, hash); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1494 } |
111 | 1495 else if (tag == LTO_tree_scc) |
1496 gcc_unreachable (); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1497 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1498 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1499 /* Otherwise, materialize a new node from IB. */ |
111 | 1500 result = lto_read_tree (ib, data_in, tag, hash); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1501 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1502 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1503 return result; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1504 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1505 |
111 | 1506 tree |
1507 lto_input_tree (struct lto_input_block *ib, struct data_in *data_in) | |
1508 { | |
1509 enum LTO_tags tag; | |
1510 | |
1511 /* Input and skip SCCs. */ | |
1512 while ((tag = streamer_read_record_start (ib)) == LTO_tree_scc) | |
1513 { | |
1514 unsigned len, entry_len; | |
1515 lto_input_scc (ib, data_in, &len, &entry_len); | |
1516 | |
1517 /* Register DECLs with the debuginfo machinery. */ | |
1518 while (!dref_queue.is_empty ()) | |
1519 { | |
1520 dref_entry e = dref_queue.pop (); | |
1521 debug_hooks->register_external_die (e.decl, e.sym, e.off); | |
1522 } | |
1523 } | |
1524 return lto_input_tree_1 (ib, data_in, tag, 0); | |
1525 } | |
1526 | |
1527 | |
1528 /* Input toplevel asms. */ | |
1529 | |
1530 void | |
1531 lto_input_toplevel_asms (struct lto_file_decl_data *file_data, int order_base) | |
1532 { | |
1533 size_t len; | |
1534 const char *data = lto_get_section_data (file_data, LTO_section_asm, | |
1535 NULL, &len); | |
1536 const struct lto_simple_header_with_strings *header | |
1537 = (const struct lto_simple_header_with_strings *) data; | |
1538 int string_offset; | |
1539 struct data_in *data_in; | |
1540 tree str; | |
1541 | |
1542 if (! data) | |
1543 return; | |
1544 | |
1545 string_offset = sizeof (*header) + header->main_size; | |
1546 | |
1547 lto_input_block ib (data + sizeof (*header), header->main_size, | |
1548 file_data->mode_table); | |
1549 | |
1550 data_in = lto_data_in_create (file_data, data + string_offset, | |
1551 header->string_size, vNULL); | |
1552 | |
1553 while ((str = streamer_read_string_cst (data_in, &ib))) | |
1554 { | |
1555 asm_node *node = symtab->finalize_toplevel_asm (str); | |
1556 node->order = streamer_read_hwi (&ib) + order_base; | |
1557 if (node->order >= symtab->order) | |
1558 symtab->order = node->order + 1; | |
1559 } | |
1560 | |
1561 lto_data_in_delete (data_in); | |
1562 | |
1563 lto_free_section_data (file_data, LTO_section_asm, NULL, data, len); | |
1564 } | |
1565 | |
1566 | |
1567 /* Input mode table. */ | |
1568 | |
1569 void | |
1570 lto_input_mode_table (struct lto_file_decl_data *file_data) | |
1571 { | |
1572 size_t len; | |
1573 const char *data = lto_get_section_data (file_data, LTO_section_mode_table, | |
1574 NULL, &len); | |
1575 if (! data) | |
1576 { | |
1577 internal_error ("cannot read LTO mode table from %s", | |
1578 file_data->file_name); | |
1579 return; | |
1580 } | |
1581 | |
1582 unsigned char *table = ggc_cleared_vec_alloc<unsigned char> (1 << 8); | |
1583 file_data->mode_table = table; | |
1584 const struct lto_simple_header_with_strings *header | |
1585 = (const struct lto_simple_header_with_strings *) data; | |
1586 int string_offset; | |
1587 struct data_in *data_in; | |
1588 string_offset = sizeof (*header) + header->main_size; | |
1589 | |
1590 lto_input_block ib (data + sizeof (*header), header->main_size, NULL); | |
1591 data_in = lto_data_in_create (file_data, data + string_offset, | |
1592 header->string_size, vNULL); | |
1593 bitpack_d bp = streamer_read_bitpack (&ib); | |
1594 | |
1595 table[VOIDmode] = VOIDmode; | |
1596 table[BLKmode] = BLKmode; | |
1597 unsigned int m; | |
1598 while ((m = bp_unpack_value (&bp, 8)) != VOIDmode) | |
1599 { | |
1600 enum mode_class mclass | |
1601 = bp_unpack_enum (&bp, mode_class, MAX_MODE_CLASS); | |
1602 unsigned int size = bp_unpack_value (&bp, 8); | |
1603 unsigned int prec = bp_unpack_value (&bp, 16); | |
1604 machine_mode inner = (machine_mode) bp_unpack_value (&bp, 8); | |
1605 unsigned int nunits = bp_unpack_value (&bp, 8); | |
1606 unsigned int ibit = 0, fbit = 0; | |
1607 unsigned int real_fmt_len = 0; | |
1608 const char *real_fmt_name = NULL; | |
1609 switch (mclass) | |
1610 { | |
1611 case MODE_FRACT: | |
1612 case MODE_UFRACT: | |
1613 case MODE_ACCUM: | |
1614 case MODE_UACCUM: | |
1615 ibit = bp_unpack_value (&bp, 8); | |
1616 fbit = bp_unpack_value (&bp, 8); | |
1617 break; | |
1618 case MODE_FLOAT: | |
1619 case MODE_DECIMAL_FLOAT: | |
1620 real_fmt_name = bp_unpack_indexed_string (data_in, &bp, | |
1621 &real_fmt_len); | |
1622 break; | |
1623 default: | |
1624 break; | |
1625 } | |
1626 /* First search just the GET_CLASS_NARROWEST_MODE to wider modes, | |
1627 if not found, fallback to all modes. */ | |
1628 int pass; | |
1629 for (pass = 0; pass < 2; pass++) | |
1630 for (machine_mode mr = pass ? VOIDmode | |
1631 : GET_CLASS_NARROWEST_MODE (mclass); | |
1632 pass ? mr < MAX_MACHINE_MODE : mr != VOIDmode; | |
1633 pass ? mr = (machine_mode) (mr + 1) | |
1634 : mr = GET_MODE_WIDER_MODE (mr).else_void ()) | |
1635 if (GET_MODE_CLASS (mr) != mclass | |
1636 || GET_MODE_SIZE (mr) != size | |
1637 || GET_MODE_PRECISION (mr) != prec | |
1638 || (inner == m | |
1639 ? GET_MODE_INNER (mr) != mr | |
1640 : GET_MODE_INNER (mr) != table[(int) inner]) | |
1641 || GET_MODE_IBIT (mr) != ibit | |
1642 || GET_MODE_FBIT (mr) != fbit | |
1643 || GET_MODE_NUNITS (mr) != nunits) | |
1644 continue; | |
1645 else if ((mclass == MODE_FLOAT || mclass == MODE_DECIMAL_FLOAT) | |
1646 && strcmp (REAL_MODE_FORMAT (mr)->name, real_fmt_name) != 0) | |
1647 continue; | |
1648 else | |
1649 { | |
1650 table[m] = mr; | |
1651 pass = 2; | |
1652 break; | |
1653 } | |
1654 unsigned int mname_len; | |
1655 const char *mname = bp_unpack_indexed_string (data_in, &bp, &mname_len); | |
1656 if (pass == 2) | |
1657 { | |
1658 switch (mclass) | |
1659 { | |
1660 case MODE_VECTOR_INT: | |
1661 case MODE_VECTOR_FLOAT: | |
1662 case MODE_VECTOR_FRACT: | |
1663 case MODE_VECTOR_UFRACT: | |
1664 case MODE_VECTOR_ACCUM: | |
1665 case MODE_VECTOR_UACCUM: | |
1666 /* For unsupported vector modes just use BLKmode, | |
1667 if the scalar mode is supported. */ | |
1668 if (table[(int) inner] != VOIDmode) | |
1669 { | |
1670 table[m] = BLKmode; | |
1671 break; | |
1672 } | |
1673 /* FALLTHRU */ | |
1674 default: | |
1675 fatal_error (UNKNOWN_LOCATION, "unsupported mode %s\n", mname); | |
1676 break; | |
1677 } | |
1678 } | |
1679 } | |
1680 lto_data_in_delete (data_in); | |
1681 | |
1682 lto_free_section_data (file_data, LTO_section_mode_table, NULL, data, len); | |
1683 } | |
1684 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1685 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1686 /* Initialization for the LTO reader. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1687 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1688 void |
111 | 1689 lto_reader_init (void) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1690 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1691 lto_streamer_init (); |
111 | 1692 file_name_hash_table |
1693 = new hash_table<freeing_string_slot_hasher> (37); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1694 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1695 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1696 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1697 /* Create a new data_in object for FILE_DATA. STRINGS is the string |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1698 table to use with LEN strings. RESOLUTIONS is the vector of linker |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1699 resolutions (NULL if not using a linker plugin). */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1700 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1701 struct data_in * |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1702 lto_data_in_create (struct lto_file_decl_data *file_data, const char *strings, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1703 unsigned len, |
111 | 1704 vec<ld_plugin_symbol_resolution_t> resolutions) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1705 { |
111 | 1706 struct data_in *data_in = new (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
|
1707 data_in->file_data = file_data; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1708 data_in->strings = strings; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1709 data_in->strings_len = len; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1710 data_in->globals_resolution = resolutions; |
111 | 1711 data_in->reader_cache = streamer_tree_cache_create (false, false, true); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1712 return data_in; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1713 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1714 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1715 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1716 /* Remove DATA_IN. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1717 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1718 void |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1719 lto_data_in_delete (struct data_in *data_in) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1720 { |
111 | 1721 data_in->globals_resolution.release (); |
1722 streamer_tree_cache_delete (data_in->reader_cache); | |
1723 delete data_in; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1724 } |