Mercurial > hg > CbC > CbC_gcc
annotate gcc/print-tree.c @ 86:12b3180c7d07
modify calls.c.
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 15 Dec 2011 02:37:13 +0900 |
parents | f6334be47118 |
children | 04ced10e8804 |
rev | line source |
---|---|
0 | 1 /* Prints out tree in human readable form - GCC |
2 Copyright (C) 1990, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
3 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
4 Free Software Foundation, Inc. |
0 | 5 |
6 This file is part of GCC. | |
7 | |
8 GCC is free software; you can redistribute it and/or modify it under | |
9 the terms of the GNU General Public License as published by the Free | |
10 Software Foundation; either version 3, or (at your option) any later | |
11 version. | |
12 | |
13 GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
19 along with GCC; see the file COPYING3. If not see | |
20 <http://www.gnu.org/licenses/>. */ | |
21 | |
22 | |
23 #include "config.h" | |
24 #include "system.h" | |
25 #include "coretypes.h" | |
26 #include "tm.h" | |
27 #include "tree.h" | |
28 #include "ggc.h" | |
29 #include "langhooks.h" | |
30 #include "tree-iterator.h" | |
31 #include "diagnostic.h" | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
32 #include "gimple-pretty-print.h" |
0 | 33 #include "tree-flow.h" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
34 #include "tree-pass.h" |
0 | 35 |
36 /* Define the hash table of nodes already seen. | |
37 Such nodes are not repeated; brief cross-references are used. */ | |
38 | |
39 #define HASH_SIZE 37 | |
40 | |
41 struct bucket | |
42 { | |
43 tree node; | |
44 struct bucket *next; | |
45 }; | |
46 | |
47 static struct bucket **table; | |
48 | |
49 /* Print the node NODE on standard error, for debugging. | |
50 Most nodes referred to by this one are printed recursively | |
51 down to a depth of six. */ | |
52 | |
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
|
53 DEBUG_FUNCTION void |
0 | 54 debug_tree (tree node) |
55 { | |
56 table = XCNEWVEC (struct bucket *, HASH_SIZE); | |
57 print_node (stderr, "", node, 0); | |
58 free (table); | |
59 table = 0; | |
60 putc ('\n', stderr); | |
61 } | |
62 | |
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
|
63 /* Print the vector of trees VEC on standard error, for debugging. |
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
|
64 Most nodes referred to by this one are printed recursively |
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
|
65 down to a depth of six. */ |
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
|
66 |
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
|
67 DEBUG_FUNCTION void |
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
|
68 debug_vec_tree (VEC(tree,gc) *vec) |
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
|
69 { |
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
|
70 table = XCNEWVEC (struct bucket *, HASH_SIZE); |
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
|
71 print_vec_tree (stderr, "", vec, 0); |
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
|
72 free (table); |
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
|
73 table = 0; |
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
|
74 putc ('\n', stderr); |
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
|
75 } |
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
|
76 |
0 | 77 /* Print PREFIX and ADDR to FILE. */ |
78 void | |
79 dump_addr (FILE *file, const char *prefix, const void *addr) | |
80 { | |
81 if (flag_dump_noaddr || flag_dump_unnumbered) | |
82 fprintf (file, "%s#", prefix); | |
83 else | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
84 fprintf (file, "%s" HOST_PTR_PRINTF, prefix, addr); |
0 | 85 } |
86 | |
87 /* Print a node in brief fashion, with just the code, address and name. */ | |
88 | |
89 void | |
90 print_node_brief (FILE *file, const char *prefix, const_tree node, int indent) | |
91 { | |
92 enum tree_code_class tclass; | |
93 | |
94 if (node == 0) | |
95 return; | |
96 | |
97 tclass = TREE_CODE_CLASS (TREE_CODE (node)); | |
98 | |
99 /* Always print the slot this node is in, and its code, address and | |
100 name if any. */ | |
101 if (indent > 0) | |
102 fprintf (file, " "); | |
103 fprintf (file, "%s <%s", prefix, tree_code_name[(int) TREE_CODE (node)]); | |
104 dump_addr (file, " ", node); | |
105 | |
106 if (tclass == tcc_declaration) | |
107 { | |
108 if (DECL_NAME (node)) | |
109 fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node))); | |
110 else if (TREE_CODE (node) == LABEL_DECL | |
111 && LABEL_DECL_UID (node) != -1) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
112 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
113 if (dump_flags & TDF_NOUID) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
114 fprintf (file, " L.xxxx"); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
115 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
116 fprintf (file, " L.%d", (int) LABEL_DECL_UID (node)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
117 } |
0 | 118 else |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
119 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
120 if (dump_flags & TDF_NOUID) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
121 fprintf (file, " %c.xxxx", |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
122 TREE_CODE (node) == CONST_DECL ? 'C' : 'D'); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
123 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
124 fprintf (file, " %c.%u", |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
125 TREE_CODE (node) == CONST_DECL ? 'C' : 'D', |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
126 DECL_UID (node)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
127 } |
0 | 128 } |
129 else if (tclass == tcc_type) | |
130 { | |
131 if (TYPE_NAME (node)) | |
132 { | |
133 if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE) | |
134 fprintf (file, " %s", IDENTIFIER_POINTER (TYPE_NAME (node))); | |
135 else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL | |
136 && DECL_NAME (TYPE_NAME (node))) | |
137 fprintf (file, " %s", | |
138 IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)))); | |
139 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
140 if (!ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node))) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
141 fprintf (file, " address-space-%d", TYPE_ADDR_SPACE (node)); |
0 | 142 } |
143 if (TREE_CODE (node) == IDENTIFIER_NODE) | |
144 fprintf (file, " %s", IDENTIFIER_POINTER (node)); | |
145 | |
146 /* We might as well always print the value of an integer or real. */ | |
147 if (TREE_CODE (node) == INTEGER_CST) | |
148 { | |
149 if (TREE_OVERFLOW (node)) | |
150 fprintf (file, " overflow"); | |
151 | |
152 fprintf (file, " "); | |
153 if (TREE_INT_CST_HIGH (node) == 0) | |
154 fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED, TREE_INT_CST_LOW (node)); | |
155 else if (TREE_INT_CST_HIGH (node) == -1 | |
156 && TREE_INT_CST_LOW (node) != 0) | |
157 fprintf (file, "-" HOST_WIDE_INT_PRINT_UNSIGNED, | |
158 -TREE_INT_CST_LOW (node)); | |
159 else | |
160 fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX, | |
161 (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node), | |
162 (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node)); | |
163 } | |
164 if (TREE_CODE (node) == REAL_CST) | |
165 { | |
166 REAL_VALUE_TYPE d; | |
167 | |
168 if (TREE_OVERFLOW (node)) | |
169 fprintf (file, " overflow"); | |
170 | |
171 d = TREE_REAL_CST (node); | |
172 if (REAL_VALUE_ISINF (d)) | |
173 fprintf (file, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf"); | |
174 else if (REAL_VALUE_ISNAN (d)) | |
175 fprintf (file, " Nan"); | |
176 else | |
177 { | |
178 char string[60]; | |
179 real_to_decimal (string, &d, sizeof (string), 0, 1); | |
180 fprintf (file, " %s", string); | |
181 } | |
182 } | |
183 if (TREE_CODE (node) == FIXED_CST) | |
184 { | |
185 FIXED_VALUE_TYPE f; | |
186 char string[60]; | |
187 | |
188 if (TREE_OVERFLOW (node)) | |
189 fprintf (file, " overflow"); | |
190 | |
191 f = TREE_FIXED_CST (node); | |
192 fixed_to_decimal (string, &f, sizeof (string)); | |
193 fprintf (file, " %s", string); | |
194 } | |
195 | |
196 fprintf (file, ">"); | |
197 } | |
198 | |
199 void | |
200 indent_to (FILE *file, int column) | |
201 { | |
202 int i; | |
203 | |
204 /* Since this is the long way, indent to desired column. */ | |
205 if (column > 0) | |
206 fprintf (file, "\n"); | |
207 for (i = 0; i < column; i++) | |
208 fprintf (file, " "); | |
209 } | |
210 | |
211 /* Print the node NODE in full on file FILE, preceded by PREFIX, | |
212 starting in column INDENT. */ | |
213 | |
214 void | |
215 print_node (FILE *file, const char *prefix, tree node, int indent) | |
216 { | |
217 int hash; | |
218 struct bucket *b; | |
219 enum machine_mode mode; | |
220 enum tree_code_class tclass; | |
221 int len; | |
222 int i; | |
223 expanded_location xloc; | |
224 enum tree_code code; | |
225 | |
226 if (node == 0) | |
227 return; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
228 |
0 | 229 code = TREE_CODE (node); |
230 tclass = TREE_CODE_CLASS (code); | |
231 | |
232 /* Don't get too deep in nesting. If the user wants to see deeper, | |
233 it is easy to use the address of a lowest-level node | |
234 as an argument in another call to debug_tree. */ | |
235 | |
236 if (indent > 24) | |
237 { | |
238 print_node_brief (file, prefix, node, indent); | |
239 return; | |
240 } | |
241 | |
242 if (indent > 8 && (tclass == tcc_type || tclass == tcc_declaration)) | |
243 { | |
244 print_node_brief (file, prefix, node, indent); | |
245 return; | |
246 } | |
247 | |
248 /* It is unsafe to look at any other fields of an ERROR_MARK node. */ | |
249 if (code == ERROR_MARK) | |
250 { | |
251 print_node_brief (file, prefix, node, indent); | |
252 return; | |
253 } | |
254 | |
255 /* Allow this function to be called if the table is not there. */ | |
256 if (table) | |
257 { | |
258 hash = ((unsigned long) node) % HASH_SIZE; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
259 |
0 | 260 /* If node is in the table, just mention its address. */ |
261 for (b = table[hash]; b; b = b->next) | |
262 if (b->node == node) | |
263 { | |
264 print_node_brief (file, prefix, node, indent); | |
265 return; | |
266 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
267 |
0 | 268 /* Add this node to the table. */ |
269 b = XNEW (struct bucket); | |
270 b->node = node; | |
271 b->next = table[hash]; | |
272 table[hash] = b; | |
273 } | |
274 | |
275 /* Indent to the specified column, since this is the long form. */ | |
276 indent_to (file, indent); | |
277 | |
278 /* Print the slot this node is in, and its code, and address. */ | |
279 fprintf (file, "%s <%s", prefix, tree_code_name[(int) code]); | |
280 dump_addr (file, " ", node); | |
281 | |
282 /* Print the name, if any. */ | |
283 if (tclass == tcc_declaration) | |
284 { | |
285 if (DECL_NAME (node)) | |
286 fprintf (file, " %s", IDENTIFIER_POINTER (DECL_NAME (node))); | |
287 else if (code == LABEL_DECL | |
288 && LABEL_DECL_UID (node) != -1) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
289 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
290 if (dump_flags & TDF_NOUID) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
291 fprintf (file, " L.xxxx"); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
292 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
293 fprintf (file, " L.%d", (int) LABEL_DECL_UID (node)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
294 } |
0 | 295 else |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
296 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
297 if (dump_flags & TDF_NOUID) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
298 fprintf (file, " %c.xxxx", code == CONST_DECL ? 'C' : 'D'); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
299 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
300 fprintf (file, " %c.%u", code == CONST_DECL ? 'C' : 'D', |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
301 DECL_UID (node)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
302 } |
0 | 303 } |
304 else if (tclass == tcc_type) | |
305 { | |
306 if (TYPE_NAME (node)) | |
307 { | |
308 if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE) | |
309 fprintf (file, " %s", IDENTIFIER_POINTER (TYPE_NAME (node))); | |
310 else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL | |
311 && DECL_NAME (TYPE_NAME (node))) | |
312 fprintf (file, " %s", | |
313 IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)))); | |
314 } | |
315 } | |
316 if (code == IDENTIFIER_NODE) | |
317 fprintf (file, " %s", IDENTIFIER_POINTER (node)); | |
318 | |
319 if (code == INTEGER_CST) | |
320 { | |
321 if (indent <= 4) | |
322 print_node_brief (file, "type", TREE_TYPE (node), indent + 4); | |
323 } | |
324 else | |
325 { | |
326 print_node (file, "type", TREE_TYPE (node), indent + 4); | |
327 if (TREE_TYPE (node)) | |
328 indent_to (file, indent + 3); | |
329 } | |
330 | |
331 if (!TYPE_P (node) && TREE_SIDE_EFFECTS (node)) | |
332 fputs (" side-effects", file); | |
333 | |
334 if (TYPE_P (node) ? TYPE_READONLY (node) : TREE_READONLY (node)) | |
335 fputs (" readonly", file); | |
336 if (!TYPE_P (node) && TREE_CONSTANT (node)) | |
337 fputs (" constant", file); | |
338 else if (TYPE_P (node) && TYPE_SIZES_GIMPLIFIED (node)) | |
339 fputs (" sizes-gimplified", file); | |
340 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
341 if (TYPE_P (node) && !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (node))) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
342 fprintf (file, " address-space-%d", TYPE_ADDR_SPACE (node)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
343 |
0 | 344 if (TREE_ADDRESSABLE (node)) |
345 fputs (" addressable", file); | |
346 if (TREE_THIS_VOLATILE (node)) | |
347 fputs (" volatile", file); | |
348 if (TREE_ASM_WRITTEN (node)) | |
349 fputs (" asm_written", file); | |
350 if (TREE_USED (node)) | |
351 fputs (" used", file); | |
352 if (TREE_NOTHROW (node)) | |
353 fputs (TYPE_P (node) ? " align-ok" : " nothrow", file); | |
354 if (TREE_PUBLIC (node)) | |
355 fputs (" public", file); | |
356 if (TREE_PRIVATE (node)) | |
357 fputs (" private", file); | |
358 if (TREE_PROTECTED (node)) | |
359 fputs (" protected", file); | |
360 if (TREE_STATIC (node)) | |
361 fputs (" static", file); | |
362 if (TREE_DEPRECATED (node)) | |
363 fputs (" deprecated", file); | |
364 if (TREE_VISITED (node)) | |
365 fputs (" visited", file); | |
366 if (TREE_LANG_FLAG_0 (node)) | |
367 fputs (" tree_0", file); | |
368 if (TREE_LANG_FLAG_1 (node)) | |
369 fputs (" tree_1", file); | |
370 if (TREE_LANG_FLAG_2 (node)) | |
371 fputs (" tree_2", file); | |
372 if (TREE_LANG_FLAG_3 (node)) | |
373 fputs (" tree_3", file); | |
374 if (TREE_LANG_FLAG_4 (node)) | |
375 fputs (" tree_4", file); | |
376 if (TREE_LANG_FLAG_5 (node)) | |
377 fputs (" tree_5", file); | |
378 if (TREE_LANG_FLAG_6 (node)) | |
379 fputs (" tree_6", file); | |
380 | |
381 /* DECL_ nodes have additional attributes. */ | |
382 | |
383 switch (TREE_CODE_CLASS (code)) | |
384 { | |
385 case tcc_declaration: | |
386 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) | |
387 { | |
388 if (DECL_UNSIGNED (node)) | |
389 fputs (" unsigned", file); | |
390 if (DECL_IGNORED_P (node)) | |
391 fputs (" ignored", file); | |
392 if (DECL_ABSTRACT (node)) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
393 fputs (" abstract", file); |
0 | 394 if (DECL_EXTERNAL (node)) |
395 fputs (" external", file); | |
396 if (DECL_NONLOCAL (node)) | |
397 fputs (" nonlocal", file); | |
398 } | |
399 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS)) | |
400 { | |
401 if (DECL_WEAK (node)) | |
402 fputs (" weak", file); | |
403 if (DECL_IN_SYSTEM_HEADER (node)) | |
404 fputs (" in_system_header", file); | |
405 } | |
406 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL) | |
407 && code != LABEL_DECL | |
408 && code != FUNCTION_DECL | |
409 && DECL_REGISTER (node)) | |
410 fputs (" regdecl", file); | |
411 | |
412 if (code == TYPE_DECL && TYPE_DECL_SUPPRESS_DEBUG (node)) | |
413 fputs (" suppress-debug", file); | |
414 | |
415 if (code == FUNCTION_DECL | |
416 && DECL_FUNCTION_SPECIFIC_TARGET (node)) | |
417 fputs (" function-specific-target", file); | |
418 if (code == FUNCTION_DECL | |
419 && DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node)) | |
420 fputs (" function-specific-opt", file); | |
421 if (code == FUNCTION_DECL && DECL_DECLARED_INLINE_P (node)) | |
422 fputs (" autoinline", file); | |
423 if (code == FUNCTION_DECL && DECL_BUILT_IN (node)) | |
424 fputs (" built-in", file); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
425 if (code == FUNCTION_DECL && DECL_STATIC_CHAIN (node)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
426 fputs (" static-chain", file); |
0 | 427 |
428 if (code == FIELD_DECL && DECL_PACKED (node)) | |
429 fputs (" packed", file); | |
430 if (code == FIELD_DECL && DECL_BIT_FIELD (node)) | |
431 fputs (" bit-field", file); | |
432 if (code == FIELD_DECL && DECL_NONADDRESSABLE_P (node)) | |
433 fputs (" nonaddressable", file); | |
434 | |
435 if (code == LABEL_DECL && DECL_ERROR_ISSUED (node)) | |
436 fputs (" error-issued", file); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
437 if (code == LABEL_DECL && EH_LANDING_PAD_NR (node)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
438 fprintf (file, " landing-pad:%d", EH_LANDING_PAD_NR (node)); |
0 | 439 |
440 if (code == VAR_DECL && DECL_IN_TEXT_SECTION (node)) | |
441 fputs (" in-text-section", file); | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
442 if (code == VAR_DECL && DECL_IN_CONSTANT_POOL (node)) |
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
|
443 fputs (" in-constant-pool", file); |
0 | 444 if (code == VAR_DECL && DECL_COMMON (node)) |
445 fputs (" common", file); | |
446 if (code == VAR_DECL && DECL_THREAD_LOCAL_P (node)) | |
447 { | |
448 enum tls_model kind = DECL_TLS_MODEL (node); | |
449 switch (kind) | |
450 { | |
451 case TLS_MODEL_GLOBAL_DYNAMIC: | |
452 fputs (" tls-global-dynamic", file); | |
453 break; | |
454 case TLS_MODEL_LOCAL_DYNAMIC: | |
455 fputs (" tls-local-dynamic", file); | |
456 break; | |
457 case TLS_MODEL_INITIAL_EXEC: | |
458 fputs (" tls-initial-exec", file); | |
459 break; | |
460 case TLS_MODEL_LOCAL_EXEC: | |
461 fputs (" tls-local-exec", file); | |
462 break; | |
463 default: | |
464 gcc_unreachable (); | |
465 } | |
466 } | |
467 | |
468 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
469 { |
0 | 470 if (DECL_VIRTUAL_P (node)) |
471 fputs (" virtual", file); | |
472 if (DECL_PRESERVE_P (node)) | |
473 fputs (" preserve", file); | |
474 if (DECL_LANG_FLAG_0 (node)) | |
475 fputs (" decl_0", file); | |
476 if (DECL_LANG_FLAG_1 (node)) | |
477 fputs (" decl_1", file); | |
478 if (DECL_LANG_FLAG_2 (node)) | |
479 fputs (" decl_2", file); | |
480 if (DECL_LANG_FLAG_3 (node)) | |
481 fputs (" decl_3", file); | |
482 if (DECL_LANG_FLAG_4 (node)) | |
483 fputs (" decl_4", file); | |
484 if (DECL_LANG_FLAG_5 (node)) | |
485 fputs (" decl_5", file); | |
486 if (DECL_LANG_FLAG_6 (node)) | |
487 fputs (" decl_6", file); | |
488 if (DECL_LANG_FLAG_7 (node)) | |
489 fputs (" decl_7", file); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
490 |
0 | 491 mode = DECL_MODE (node); |
492 fprintf (file, " %s", GET_MODE_NAME (mode)); | |
493 } | |
494 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
495 if ((code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
496 && DECL_BY_REFERENCE (node)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
497 fputs (" passed-by-reference", file); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
498 |
0 | 499 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS) && DECL_DEFER_OUTPUT (node)) |
500 fputs (" defer-output", file); | |
501 | |
502 | |
503 xloc = expand_location (DECL_SOURCE_LOCATION (node)); | |
504 fprintf (file, " file %s line %d col %d", xloc.file, xloc.line, | |
505 xloc.column); | |
506 | |
507 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
508 { |
0 | 509 print_node (file, "size", DECL_SIZE (node), indent + 4); |
510 print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
511 |
0 | 512 if (code != FUNCTION_DECL || DECL_BUILT_IN (node)) |
513 indent_to (file, indent + 3); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
514 |
0 | 515 if (DECL_USER_ALIGN (node)) |
516 fprintf (file, " user"); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
517 |
0 | 518 fprintf (file, " align %d", DECL_ALIGN (node)); |
519 if (code == FIELD_DECL) | |
520 fprintf (file, " offset_align " HOST_WIDE_INT_PRINT_UNSIGNED, | |
521 DECL_OFFSET_ALIGN (node)); | |
522 | |
523 if (code == FUNCTION_DECL && DECL_BUILT_IN (node)) | |
524 { | |
525 if (DECL_BUILT_IN_CLASS (node) == BUILT_IN_MD) | |
526 fprintf (file, " built-in BUILT_IN_MD %d", DECL_FUNCTION_CODE (node)); | |
527 else | |
528 fprintf (file, " built-in %s:%s", | |
529 built_in_class_names[(int) DECL_BUILT_IN_CLASS (node)], | |
530 built_in_names[(int) DECL_FUNCTION_CODE (node)]); | |
531 } | |
532 } | |
533 if (code == FIELD_DECL) | |
534 { | |
535 print_node (file, "offset", DECL_FIELD_OFFSET (node), indent + 4); | |
536 print_node (file, "bit offset", DECL_FIELD_BIT_OFFSET (node), | |
537 indent + 4); | |
538 if (DECL_BIT_FIELD_TYPE (node)) | |
539 print_node (file, "bit_field_type", DECL_BIT_FIELD_TYPE (node), | |
540 indent + 4); | |
541 } | |
542 | |
543 print_node_brief (file, "context", DECL_CONTEXT (node), indent + 4); | |
544 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
545 if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON)) |
0 | 546 { |
547 print_node_brief (file, "attributes", | |
548 DECL_ATTRIBUTES (node), indent + 4); | |
549 if (code != PARM_DECL) | |
550 print_node_brief (file, "initial", DECL_INITIAL (node), | |
551 indent + 4); | |
552 } | |
553 if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL)) | |
554 { | |
555 print_node_brief (file, "abstract_origin", | |
556 DECL_ABSTRACT_ORIGIN (node), indent + 4); | |
557 } | |
558 if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON)) | |
559 { | |
560 print_node (file, "arguments", DECL_ARGUMENT_FLD (node), indent + 4); | |
561 print_node (file, "result", DECL_RESULT_FLD (node), indent + 4); | |
562 } | |
563 | |
564 lang_hooks.print_decl (file, node, indent); | |
565 | |
566 if (DECL_RTL_SET_P (node)) | |
567 { | |
568 indent_to (file, indent + 4); | |
569 print_rtl (file, DECL_RTL (node)); | |
570 } | |
571 | |
572 if (code == PARM_DECL) | |
573 { | |
574 print_node (file, "arg-type", DECL_ARG_TYPE (node), indent + 4); | |
575 | |
576 if (DECL_INCOMING_RTL (node) != 0) | |
577 { | |
578 indent_to (file, indent + 4); | |
579 fprintf (file, "incoming-rtl "); | |
580 print_rtl (file, DECL_INCOMING_RTL (node)); | |
581 } | |
582 } | |
583 else if (code == FUNCTION_DECL | |
584 && DECL_STRUCT_FUNCTION (node) != 0) | |
585 { | |
586 indent_to (file, indent + 4); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
587 dump_addr (file, "struct-function ", DECL_STRUCT_FUNCTION (node)); |
0 | 588 } |
589 | |
590 if ((code == VAR_DECL || code == PARM_DECL) | |
591 && DECL_HAS_VALUE_EXPR_P (node)) | |
592 print_node (file, "value-expr", DECL_VALUE_EXPR (node), indent + 4); | |
593 | |
594 /* Print the decl chain only if decl is at second level. */ | |
595 if (indent == 4) | |
596 print_node (file, "chain", TREE_CHAIN (node), indent + 4); | |
597 else | |
598 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4); | |
599 break; | |
600 | |
601 case tcc_type: | |
602 if (TYPE_UNSIGNED (node)) | |
603 fputs (" unsigned", file); | |
604 | |
605 /* The no-force-blk flag is used for different things in | |
606 different types. */ | |
607 if ((code == RECORD_TYPE | |
608 || code == UNION_TYPE | |
609 || code == QUAL_UNION_TYPE) | |
610 && TYPE_NO_FORCE_BLK (node)) | |
611 fputs (" no-force-blk", file); | |
612 else if (code == INTEGER_TYPE | |
613 && TYPE_IS_SIZETYPE (node)) | |
614 fputs (" sizetype", file); | |
615 | |
616 if (TYPE_STRING_FLAG (node)) | |
617 fputs (" string-flag", file); | |
618 if (TYPE_NEEDS_CONSTRUCTING (node)) | |
619 fputs (" needs-constructing", file); | |
620 | |
621 /* The transparent-union flag is used for different things in | |
622 different nodes. */ | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
623 if ((code == UNION_TYPE || code == RECORD_TYPE) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
624 && TYPE_TRANSPARENT_AGGR (node)) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
625 fputs (" transparent-aggr", file); |
0 | 626 else if (code == ARRAY_TYPE |
627 && TYPE_NONALIASED_COMPONENT (node)) | |
628 fputs (" nonaliased-component", file); | |
629 | |
630 if (TYPE_PACKED (node)) | |
631 fputs (" packed", file); | |
632 | |
633 if (TYPE_RESTRICT (node)) | |
634 fputs (" restrict", file); | |
635 | |
636 if (TYPE_LANG_FLAG_0 (node)) | |
637 fputs (" type_0", file); | |
638 if (TYPE_LANG_FLAG_1 (node)) | |
639 fputs (" type_1", file); | |
640 if (TYPE_LANG_FLAG_2 (node)) | |
641 fputs (" type_2", file); | |
642 if (TYPE_LANG_FLAG_3 (node)) | |
643 fputs (" type_3", file); | |
644 if (TYPE_LANG_FLAG_4 (node)) | |
645 fputs (" type_4", file); | |
646 if (TYPE_LANG_FLAG_5 (node)) | |
647 fputs (" type_5", file); | |
648 if (TYPE_LANG_FLAG_6 (node)) | |
649 fputs (" type_6", file); | |
650 | |
651 mode = TYPE_MODE (node); | |
652 fprintf (file, " %s", GET_MODE_NAME (mode)); | |
653 | |
654 print_node (file, "size", TYPE_SIZE (node), indent + 4); | |
655 print_node (file, "unit size", TYPE_SIZE_UNIT (node), indent + 4); | |
656 indent_to (file, indent + 3); | |
657 | |
658 if (TYPE_USER_ALIGN (node)) | |
659 fprintf (file, " user"); | |
660 | |
661 fprintf (file, " align %d symtab %d alias set " HOST_WIDE_INT_PRINT_DEC, | |
662 TYPE_ALIGN (node), TYPE_SYMTAB_ADDRESS (node), | |
663 (HOST_WIDE_INT) TYPE_ALIAS_SET (node)); | |
664 | |
665 if (TYPE_STRUCTURAL_EQUALITY_P (node)) | |
666 fprintf (file, " structural equality"); | |
667 else | |
668 dump_addr (file, " canonical type ", TYPE_CANONICAL (node)); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
669 |
0 | 670 print_node (file, "attributes", TYPE_ATTRIBUTES (node), indent + 4); |
671 | |
672 if (INTEGRAL_TYPE_P (node) || code == REAL_TYPE | |
673 || code == FIXED_POINT_TYPE) | |
674 { | |
675 fprintf (file, " precision %d", TYPE_PRECISION (node)); | |
676 print_node_brief (file, "min", TYPE_MIN_VALUE (node), indent + 4); | |
677 print_node_brief (file, "max", TYPE_MAX_VALUE (node), indent + 4); | |
678 } | |
679 | |
680 if (code == ENUMERAL_TYPE) | |
681 print_node (file, "values", TYPE_VALUES (node), indent + 4); | |
682 else if (code == ARRAY_TYPE) | |
683 print_node (file, "domain", TYPE_DOMAIN (node), indent + 4); | |
684 else if (code == VECTOR_TYPE) | |
685 fprintf (file, " nunits %d", (int) TYPE_VECTOR_SUBPARTS (node)); | |
686 else if (code == RECORD_TYPE | |
687 || code == UNION_TYPE | |
688 || code == QUAL_UNION_TYPE) | |
689 print_node (file, "fields", TYPE_FIELDS (node), indent + 4); | |
690 else if (code == FUNCTION_TYPE | |
691 || code == METHOD_TYPE) | |
692 { | |
693 if (TYPE_METHOD_BASETYPE (node)) | |
694 print_node_brief (file, "method basetype", | |
695 TYPE_METHOD_BASETYPE (node), indent + 4); | |
696 print_node (file, "arg-types", TYPE_ARG_TYPES (node), indent + 4); | |
697 } | |
698 else if (code == OFFSET_TYPE) | |
699 print_node_brief (file, "basetype", TYPE_OFFSET_BASETYPE (node), | |
700 indent + 4); | |
701 | |
702 if (TYPE_CONTEXT (node)) | |
703 print_node_brief (file, "context", TYPE_CONTEXT (node), indent + 4); | |
704 | |
705 lang_hooks.print_type (file, node, indent); | |
706 | |
707 if (TYPE_POINTER_TO (node) || TREE_CHAIN (node)) | |
708 indent_to (file, indent + 3); | |
709 | |
710 print_node_brief (file, "pointer_to_this", TYPE_POINTER_TO (node), | |
711 indent + 4); | |
712 print_node_brief (file, "reference_to_this", TYPE_REFERENCE_TO (node), | |
713 indent + 4); | |
714 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4); | |
715 break; | |
716 | |
717 case tcc_expression: | |
718 case tcc_comparison: | |
719 case tcc_unary: | |
720 case tcc_binary: | |
721 case tcc_reference: | |
722 case tcc_statement: | |
723 case tcc_vl_exp: | |
724 if (code == BIND_EXPR) | |
725 { | |
726 print_node (file, "vars", TREE_OPERAND (node, 0), indent + 4); | |
727 print_node (file, "body", TREE_OPERAND (node, 1), indent + 4); | |
728 print_node (file, "block", TREE_OPERAND (node, 2), indent + 4); | |
729 break; | |
730 } | |
731 if (code == CALL_EXPR) | |
732 { | |
733 call_expr_arg_iterator iter; | |
734 tree arg; | |
735 print_node (file, "fn", CALL_EXPR_FN (node), indent + 4); | |
736 print_node (file, "static_chain", CALL_EXPR_STATIC_CHAIN (node), | |
737 indent + 4); | |
738 i = 0; | |
739 FOR_EACH_CALL_EXPR_ARG (arg, iter, node) | |
740 { | |
741 char temp[10]; | |
742 sprintf (temp, "arg %d", i); | |
743 print_node (file, temp, arg, indent + 4); | |
744 i++; | |
745 } | |
746 } | |
747 else | |
748 { | |
749 len = TREE_OPERAND_LENGTH (node); | |
750 | |
751 for (i = 0; i < len; i++) | |
752 { | |
753 char temp[10]; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
754 |
0 | 755 sprintf (temp, "arg %d", i); |
756 print_node (file, temp, TREE_OPERAND (node, i), indent + 4); | |
757 } | |
758 } | |
759 print_node (file, "chain", TREE_CHAIN (node), indent + 4); | |
760 break; | |
761 | |
762 case tcc_constant: | |
763 case tcc_exceptional: | |
764 switch (code) | |
765 { | |
766 case INTEGER_CST: | |
767 if (TREE_OVERFLOW (node)) | |
768 fprintf (file, " overflow"); | |
769 | |
770 fprintf (file, " "); | |
771 if (TREE_INT_CST_HIGH (node) == 0) | |
772 fprintf (file, HOST_WIDE_INT_PRINT_UNSIGNED, | |
773 TREE_INT_CST_LOW (node)); | |
774 else if (TREE_INT_CST_HIGH (node) == -1 | |
775 && TREE_INT_CST_LOW (node) != 0) | |
776 fprintf (file, "-" HOST_WIDE_INT_PRINT_UNSIGNED, | |
777 -TREE_INT_CST_LOW (node)); | |
778 else | |
779 fprintf (file, HOST_WIDE_INT_PRINT_DOUBLE_HEX, | |
780 (unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (node), | |
781 (unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (node)); | |
782 break; | |
783 | |
784 case REAL_CST: | |
785 { | |
786 REAL_VALUE_TYPE d; | |
787 | |
788 if (TREE_OVERFLOW (node)) | |
789 fprintf (file, " overflow"); | |
790 | |
791 d = TREE_REAL_CST (node); | |
792 if (REAL_VALUE_ISINF (d)) | |
793 fprintf (file, REAL_VALUE_NEGATIVE (d) ? " -Inf" : " Inf"); | |
794 else if (REAL_VALUE_ISNAN (d)) | |
795 fprintf (file, " Nan"); | |
796 else | |
797 { | |
798 char string[64]; | |
799 real_to_decimal (string, &d, sizeof (string), 0, 1); | |
800 fprintf (file, " %s", string); | |
801 } | |
802 } | |
803 break; | |
804 | |
805 case FIXED_CST: | |
806 { | |
807 FIXED_VALUE_TYPE f; | |
808 char string[64]; | |
809 | |
810 if (TREE_OVERFLOW (node)) | |
811 fprintf (file, " overflow"); | |
812 | |
813 f = TREE_FIXED_CST (node); | |
814 fixed_to_decimal (string, &f, sizeof (string)); | |
815 fprintf (file, " %s", string); | |
816 } | |
817 break; | |
818 | |
819 case VECTOR_CST: | |
820 { | |
821 tree vals = TREE_VECTOR_CST_ELTS (node); | |
822 char buf[10]; | |
823 tree link; | |
824 int i; | |
825 | |
826 i = 0; | |
827 for (link = vals; link; link = TREE_CHAIN (link), ++i) | |
828 { | |
829 sprintf (buf, "elt%d: ", i); | |
830 print_node (file, buf, TREE_VALUE (link), indent + 4); | |
831 } | |
832 } | |
833 break; | |
834 | |
835 case COMPLEX_CST: | |
836 print_node (file, "real", TREE_REALPART (node), indent + 4); | |
837 print_node (file, "imag", TREE_IMAGPART (node), indent + 4); | |
838 break; | |
839 | |
840 case STRING_CST: | |
841 { | |
842 const char *p = TREE_STRING_POINTER (node); | |
843 int i = TREE_STRING_LENGTH (node); | |
844 fputs (" \"", file); | |
845 while (--i >= 0) | |
846 { | |
847 char ch = *p++; | |
848 if (ch >= ' ' && ch < 127) | |
849 putc (ch, file); | |
850 else | |
851 fprintf(file, "\\%03o", ch & 0xFF); | |
852 } | |
853 fputc ('\"', file); | |
854 } | |
855 /* Print the chain at second level. */ | |
856 if (indent == 4) | |
857 print_node (file, "chain", TREE_CHAIN (node), indent + 4); | |
858 else | |
859 print_node_brief (file, "chain", TREE_CHAIN (node), indent + 4); | |
860 break; | |
861 | |
862 case IDENTIFIER_NODE: | |
863 lang_hooks.print_identifier (file, node, indent); | |
864 break; | |
865 | |
866 case TREE_LIST: | |
867 print_node (file, "purpose", TREE_PURPOSE (node), indent + 4); | |
868 print_node (file, "value", TREE_VALUE (node), indent + 4); | |
869 print_node (file, "chain", TREE_CHAIN (node), indent + 4); | |
870 break; | |
871 | |
872 case TREE_VEC: | |
873 len = TREE_VEC_LENGTH (node); | |
874 for (i = 0; i < len; i++) | |
875 if (TREE_VEC_ELT (node, i)) | |
876 { | |
877 char temp[10]; | |
878 sprintf (temp, "elt %d", i); | |
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
|
879 print_node (file, temp, TREE_VEC_ELT (node, i), indent + 4); |
0 | 880 } |
881 break; | |
882 | |
883 case CONSTRUCTOR: | |
884 { | |
885 unsigned HOST_WIDE_INT cnt; | |
886 tree index, value; | |
887 len = VEC_length (constructor_elt, CONSTRUCTOR_ELTS (node)); | |
888 fprintf (file, " lngt %d", len); | |
889 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (node), | |
890 cnt, index, value) | |
891 { | |
892 print_node (file, "idx", index, indent + 4); | |
893 print_node (file, "val", value, indent + 4); | |
894 } | |
895 } | |
896 break; | |
897 | |
898 case STATEMENT_LIST: | |
899 dump_addr (file, " head ", node->stmt_list.head); | |
900 dump_addr (file, " tail ", node->stmt_list.tail); | |
901 fprintf (file, " stmts"); | |
902 { | |
903 tree_stmt_iterator i; | |
904 for (i = tsi_start (node); !tsi_end_p (i); tsi_next (&i)) | |
905 { | |
906 /* Not printing the addresses of the (not-a-tree) | |
907 'struct tree_stmt_list_node's. */ | |
908 dump_addr (file, " ", tsi_stmt (i)); | |
909 } | |
910 fprintf (file, "\n"); | |
911 for (i = tsi_start (node); !tsi_end_p (i); tsi_next (&i)) | |
912 { | |
913 /* Not printing the addresses of the (not-a-tree) | |
914 'struct tree_stmt_list_node's. */ | |
915 print_node (file, "stmt", tsi_stmt (i), indent + 4); | |
916 } | |
917 } | |
918 print_node (file, "chain", TREE_CHAIN (node), indent + 4); | |
919 break; | |
920 | |
921 case BLOCK: | |
922 print_node (file, "vars", BLOCK_VARS (node), indent + 4); | |
923 print_node (file, "supercontext", BLOCK_SUPERCONTEXT (node), | |
924 indent + 4); | |
925 print_node (file, "subblocks", BLOCK_SUBBLOCKS (node), indent + 4); | |
926 print_node (file, "chain", BLOCK_CHAIN (node), indent + 4); | |
927 print_node (file, "abstract_origin", | |
928 BLOCK_ABSTRACT_ORIGIN (node), indent + 4); | |
929 break; | |
930 | |
931 case SSA_NAME: | |
932 print_node_brief (file, "var", SSA_NAME_VAR (node), indent + 4); | |
933 fprintf (file, "def_stmt "); | |
934 print_gimple_stmt (file, SSA_NAME_DEF_STMT (node), indent + 4, 0); | |
935 | |
936 indent_to (file, indent + 4); | |
937 fprintf (file, "version %u", SSA_NAME_VERSION (node)); | |
938 if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (node)) | |
939 fprintf (file, " in-abnormal-phi"); | |
940 if (SSA_NAME_IN_FREE_LIST (node)) | |
941 fprintf (file, " in-free-list"); | |
942 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
943 if (SSA_NAME_PTR_INFO (node)) |
0 | 944 { |
945 indent_to (file, indent + 3); | |
946 if (SSA_NAME_PTR_INFO (node)) | |
947 dump_addr (file, " ptr-info ", SSA_NAME_PTR_INFO (node)); | |
948 } | |
949 break; | |
950 | |
951 case OMP_CLAUSE: | |
952 { | |
953 int i; | |
954 fprintf (file, " %s", | |
955 omp_clause_code_name[OMP_CLAUSE_CODE (node)]); | |
956 for (i = 0; i < omp_clause_num_ops[OMP_CLAUSE_CODE (node)]; i++) | |
957 { | |
958 indent_to (file, indent + 4); | |
959 fprintf (file, "op %d:", i); | |
960 print_node_brief (file, "", OMP_CLAUSE_OPERAND (node, i), 0); | |
961 } | |
962 } | |
963 break; | |
964 | |
965 case OPTIMIZATION_NODE: | |
966 cl_optimization_print (file, indent + 4, TREE_OPTIMIZATION (node)); | |
967 break; | |
968 | |
969 case TARGET_OPTION_NODE: | |
970 cl_target_option_print (file, indent + 4, TREE_TARGET_OPTION (node)); | |
971 break; | |
972 case IMPORTED_DECL: | |
973 fprintf (file, " imported declaration"); | |
974 print_node_brief (file, "associated declaration", | |
975 IMPORTED_DECL_ASSOCIATED_DECL (node), | |
976 indent + 4); | |
977 break; | |
978 | |
979 default: | |
980 if (EXCEPTIONAL_CLASS_P (node)) | |
981 lang_hooks.print_xnode (file, node, indent); | |
982 break; | |
983 } | |
984 | |
985 break; | |
986 } | |
987 | |
988 if (EXPR_HAS_LOCATION (node)) | |
989 { | |
990 expanded_location xloc = expand_location (EXPR_LOCATION (node)); | |
991 indent_to (file, indent+4); | |
992 fprintf (file, "%s:%d:%d", xloc.file, xloc.line, xloc.column); | |
993 } | |
994 | |
995 fprintf (file, ">"); | |
996 } | |
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
|
997 |
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
|
998 /* Print the tree vector VEC in full on file FILE, preceded by PREFIX, |
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
|
999 starting in column INDENT. */ |
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
|
1000 |
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
|
1001 void |
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
|
1002 print_vec_tree (FILE *file, const char *prefix, VEC(tree,gc) *vec, int indent) |
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
|
1003 { |
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
|
1004 tree elt; |
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
|
1005 unsigned ix; |
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
|
1006 |
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
|
1007 /* Indent to the specified column, since this is the long form. */ |
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
|
1008 indent_to (file, indent); |
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
|
1009 |
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
|
1010 /* Print the slot this node is in, and its code, and address. */ |
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
|
1011 fprintf (file, "%s <VEC", prefix); |
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
|
1012 dump_addr (file, " ", vec); |
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
|
1013 |
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
|
1014 FOR_EACH_VEC_ELT (tree, vec, ix, elt) |
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
|
1015 { |
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
|
1016 char temp[10]; |
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
|
1017 sprintf (temp, "elt %d", ix); |
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
|
1018 print_node (file, temp, elt, indent + 4); |
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
|
1019 } |
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
|
1020 } |