Mercurial > hg > CbC > CbC_gcc
annotate gcc/gimple-pretty-print.c @ 125:2c7bdd5a49f6
supress return with no value, in function returning non-void warning on goto code segment in normal function
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 01 Apr 2018 14:05:45 +0900 |
parents | 04ced10e8804 |
children | 84e7813d76e9 |
rev | line source |
---|---|
0 | 1 /* Pretty formatting of GIMPLE statements and expressions. |
111 | 2 Copyright (C) 2001-2017 Free Software Foundation, Inc. |
0 | 3 Contributed by Aldy Hernandez <aldyh@redhat.com> and |
4 Diego Novillo <dnovillo@google.com> | |
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 #include "config.h" | |
23 #include "system.h" | |
24 #include "coretypes.h" | |
111 | 25 #include "dumpfile.h" |
26 #include "backend.h" | |
0 | 27 #include "tree.h" |
111 | 28 #include "gimple.h" |
29 #include "gimple-predict.h" | |
30 #include "ssa.h" | |
31 #include "cgraph.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" |
111 | 33 #include "internal-fn.h" |
34 #include "tree-eh.h" | |
35 #include "gimple-iterator.h" | |
36 #include "tree-cfg.h" | |
37 #include "dumpfile.h" /* for dump_flags */ | |
0 | 38 #include "value-prof.h" |
111 | 39 #include "trans-mem.h" |
40 #include "cfganal.h" | |
41 #include "stringpool.h" | |
42 #include "attribs.h" | |
43 #include "asan.h" | |
0 | 44 |
45 #define INDENT(SPACE) \ | |
46 do { int i; for (i = 0; i < SPACE; i++) pp_space (buffer); } while (0) | |
47 | |
48 #define GIMPLE_NIY do_niy (buffer,gs) | |
49 | |
50 /* Try to print on BUFFER a default message for the unrecognized | |
51 gimple statement GS. */ | |
52 | |
53 static void | |
111 | 54 do_niy (pretty_printer *buffer, gimple *gs) |
0 | 55 { |
56 pp_printf (buffer, "<<< Unknown GIMPLE statement: %s >>>\n", | |
57 gimple_code_name[(int) gimple_code (gs)]); | |
58 } | |
59 | |
60 | |
111 | 61 /* Emit a newline and SPC indentation spaces to BUFFER. */ |
0 | 62 |
63 static void | |
64 newline_and_indent (pretty_printer *buffer, int spc) | |
65 { | |
66 pp_newline (buffer); | |
67 INDENT (spc); | |
68 } | |
69 | |
70 | |
71 /* Print the GIMPLE statement GS on stderr. */ | |
72 | |
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
|
73 DEBUG_FUNCTION void |
111 | 74 debug_gimple_stmt (gimple *gs) |
0 | 75 { |
76 print_gimple_stmt (stderr, gs, 0, TDF_VOPS|TDF_MEMSYMS); | |
77 } | |
78 | |
79 | |
111 | 80 /* Return formatted string of a VALUE probability |
81 (biased by REG_BR_PROB_BASE). Returned string is allocated | |
82 by xstrdup_for_dump. */ | |
83 | |
84 static const char * | |
85 dump_profile (int frequency, profile_count &count) | |
86 { | |
87 float minimum = 0.01f; | |
88 | |
89 gcc_assert (0 <= frequency && frequency <= REG_BR_PROB_BASE); | |
90 float fvalue = frequency * 100.0f / REG_BR_PROB_BASE; | |
91 if (fvalue < minimum && frequency > 0) | |
92 return "[0.01%]"; | |
93 | |
94 char *buf; | |
95 if (count.initialized_p ()) | |
96 buf = xasprintf ("[%.2f%%] [count: %" PRId64 "]", fvalue, | |
97 count.to_gcov_type ()); | |
98 else | |
99 buf = xasprintf ("[%.2f%%] [count: INV]", fvalue); | |
100 | |
101 const char *ret = xstrdup_for_dump (buf); | |
102 free (buf); | |
103 | |
104 return ret; | |
105 } | |
106 | |
107 /* Return formatted string of a VALUE probability | |
108 (biased by REG_BR_PROB_BASE). Returned string is allocated | |
109 by xstrdup_for_dump. */ | |
110 | |
111 static const char * | |
112 dump_probability (profile_probability probability) | |
113 { | |
114 float minimum = 0.01f; | |
115 float fvalue = -1; | |
116 | |
117 if (probability.initialized_p ()) | |
118 { | |
119 fvalue = probability.to_reg_br_prob_base () * 100.0f / REG_BR_PROB_BASE; | |
120 if (fvalue < minimum && probability.to_reg_br_prob_base ()) | |
121 fvalue = minimum; | |
122 } | |
123 | |
124 char *buf; | |
125 if (probability.initialized_p ()) | |
126 buf = xasprintf ("[%.2f%%]", fvalue); | |
127 else | |
128 buf = xasprintf ("[INV]"); | |
129 | |
130 const char *ret = xstrdup_for_dump (buf); | |
131 free (buf); | |
132 | |
133 return ret; | |
134 } | |
135 | |
136 /* Dump E probability to BUFFER. */ | |
137 | |
138 static void | |
139 dump_edge_probability (pretty_printer *buffer, edge e) | |
140 { | |
141 pp_scalar (buffer, " %s", dump_probability (e->probability)); | |
142 } | |
143 | |
144 /* Print GIMPLE statement G to FILE using SPC indentation spaces and | |
145 FLAGS as in pp_gimple_stmt_1. */ | |
0 | 146 |
147 void | |
111 | 148 print_gimple_stmt (FILE *file, gimple *g, int spc, dump_flags_t flags) |
149 { | |
150 pretty_printer buffer; | |
151 pp_needs_newline (&buffer) = true; | |
152 buffer.buffer->stream = file; | |
153 pp_gimple_stmt_1 (&buffer, g, spc, flags); | |
154 pp_newline_and_flush (&buffer); | |
155 } | |
156 | |
157 DEBUG_FUNCTION void | |
158 debug (gimple &ref) | |
159 { | |
160 print_gimple_stmt (stderr, &ref, 0, 0); | |
161 } | |
162 | |
163 DEBUG_FUNCTION void | |
164 debug (gimple *ptr) | |
0 | 165 { |
111 | 166 if (ptr) |
167 debug (*ptr); | |
168 else | |
169 fprintf (stderr, "<nil>\n"); | |
170 } | |
171 | |
172 | |
173 /* Print GIMPLE statement G to FILE using SPC indentation spaces and | |
174 FLAGS as in pp_gimple_stmt_1. Print only the right-hand side | |
175 of the statement. */ | |
176 | |
177 void | |
178 print_gimple_expr (FILE *file, gimple *g, int spc, dump_flags_t flags) | |
179 { | |
180 flags |= TDF_RHS_ONLY; | |
181 pretty_printer buffer; | |
182 pp_needs_newline (&buffer) = true; | |
183 buffer.buffer->stream = file; | |
184 pp_gimple_stmt_1 (&buffer, g, spc, flags); | |
0 | 185 pp_flush (&buffer); |
186 } | |
187 | |
188 | |
111 | 189 /* Print the GIMPLE sequence SEQ on BUFFER using SPC indentation |
190 spaces and FLAGS as in pp_gimple_stmt_1. | |
191 The caller is responsible for calling pp_flush on BUFFER to finalize | |
192 the pretty printer. */ | |
0 | 193 |
194 static void | |
111 | 195 dump_gimple_seq (pretty_printer *buffer, gimple_seq seq, int spc, |
196 dump_flags_t flags) | |
0 | 197 { |
198 gimple_stmt_iterator i; | |
199 | |
200 for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i)) | |
201 { | |
111 | 202 gimple *gs = gsi_stmt (i); |
0 | 203 INDENT (spc); |
111 | 204 pp_gimple_stmt_1 (buffer, gs, spc, flags); |
0 | 205 if (!gsi_one_before_end_p (i)) |
206 pp_newline (buffer); | |
207 } | |
208 } | |
209 | |
210 | |
111 | 211 /* Print GIMPLE sequence SEQ to FILE using SPC indentation spaces and |
212 FLAGS as in pp_gimple_stmt_1. */ | |
0 | 213 |
214 void | |
111 | 215 print_gimple_seq (FILE *file, gimple_seq seq, int spc, dump_flags_t flags) |
0 | 216 { |
111 | 217 pretty_printer buffer; |
218 pp_needs_newline (&buffer) = true; | |
219 buffer.buffer->stream = file; | |
0 | 220 dump_gimple_seq (&buffer, seq, spc, flags); |
111 | 221 pp_newline_and_flush (&buffer); |
0 | 222 } |
223 | |
224 | |
225 /* Print the GIMPLE sequence SEQ on stderr. */ | |
226 | |
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
|
227 DEBUG_FUNCTION void |
0 | 228 debug_gimple_seq (gimple_seq seq) |
229 { | |
230 print_gimple_seq (stderr, seq, 0, TDF_VOPS|TDF_MEMSYMS); | |
231 } | |
232 | |
233 | |
234 /* A simple helper to pretty-print some of the gimple tuples in the printf | |
111 | 235 style. The format modifiers are preceded by '%' and are: |
0 | 236 'G' - outputs a string corresponding to the code of the given gimple, |
237 'S' - outputs a gimple_seq with indent of spc + 2, | |
238 'T' - outputs the tree t, | |
239 'd' - outputs an int as a decimal, | |
240 's' - outputs a string, | |
241 'n' - outputs a newline, | |
111 | 242 'x' - outputs an int as hexadecimal, |
0 | 243 '+' - increases indent by 2 then outputs a newline, |
244 '-' - decreases indent by 2 then outputs a newline. */ | |
245 | |
246 static void | |
111 | 247 dump_gimple_fmt (pretty_printer *buffer, int spc, dump_flags_t flags, |
0 | 248 const char *fmt, ...) |
249 { | |
250 va_list args; | |
251 const char *c; | |
252 const char *tmp; | |
253 | |
254 va_start (args, fmt); | |
255 for (c = fmt; *c; c++) | |
256 { | |
257 if (*c == '%') | |
258 { | |
259 gimple_seq seq; | |
260 tree t; | |
111 | 261 gimple *g; |
0 | 262 switch (*++c) |
263 { | |
264 case 'G': | |
111 | 265 g = va_arg (args, gimple *); |
0 | 266 tmp = gimple_code_name[gimple_code (g)]; |
267 pp_string (buffer, tmp); | |
268 break; | |
269 | |
270 case 'S': | |
271 seq = va_arg (args, gimple_seq); | |
272 pp_newline (buffer); | |
273 dump_gimple_seq (buffer, seq, spc + 2, flags); | |
274 newline_and_indent (buffer, spc); | |
275 break; | |
276 | |
277 case 'T': | |
278 t = va_arg (args, tree); | |
279 if (t == NULL_TREE) | |
280 pp_string (buffer, "NULL"); | |
281 else | |
282 dump_generic_node (buffer, t, spc, flags, false); | |
283 break; | |
284 | |
285 case 'd': | |
286 pp_decimal_int (buffer, va_arg (args, int)); | |
287 break; | |
288 | |
289 case 's': | |
290 pp_string (buffer, va_arg (args, char *)); | |
291 break; | |
292 | |
293 case 'n': | |
294 newline_and_indent (buffer, spc); | |
295 break; | |
296 | |
111 | 297 case 'x': |
298 pp_scalar (buffer, "%x", va_arg (args, int)); | |
299 break; | |
300 | |
0 | 301 case '+': |
302 spc += 2; | |
303 newline_and_indent (buffer, spc); | |
304 break; | |
305 | |
306 case '-': | |
307 spc -= 2; | |
308 newline_and_indent (buffer, spc); | |
309 break; | |
310 | |
311 default: | |
312 gcc_unreachable (); | |
313 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
314 } |
0 | 315 else |
316 pp_character (buffer, *c); | |
317 } | |
318 va_end (args); | |
319 } | |
320 | |
321 | |
322 /* Helper for dump_gimple_assign. Print the unary RHS of the | |
111 | 323 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */ |
0 | 324 |
325 static void | |
111 | 326 dump_unary_rhs (pretty_printer *buffer, gassign *gs, int spc, |
327 dump_flags_t flags) | |
0 | 328 { |
329 enum tree_code rhs_code = gimple_assign_rhs_code (gs); | |
330 tree lhs = gimple_assign_lhs (gs); | |
331 tree rhs = gimple_assign_rhs1 (gs); | |
332 | |
333 switch (rhs_code) | |
334 { | |
335 case VIEW_CONVERT_EXPR: | |
336 case ASSERT_EXPR: | |
337 dump_generic_node (buffer, rhs, spc, flags, false); | |
338 break; | |
339 | |
340 case FIXED_CONVERT_EXPR: | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
341 case ADDR_SPACE_CONVERT_EXPR: |
0 | 342 case FIX_TRUNC_EXPR: |
343 case FLOAT_EXPR: | |
344 CASE_CONVERT: | |
111 | 345 pp_left_paren (buffer); |
0 | 346 dump_generic_node (buffer, TREE_TYPE (lhs), spc, flags, false); |
347 pp_string (buffer, ") "); | |
348 if (op_prio (rhs) < op_code_prio (rhs_code)) | |
349 { | |
111 | 350 pp_left_paren (buffer); |
0 | 351 dump_generic_node (buffer, rhs, spc, flags, false); |
111 | 352 pp_right_paren (buffer); |
0 | 353 } |
354 else | |
355 dump_generic_node (buffer, rhs, spc, flags, false); | |
356 break; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
357 |
0 | 358 case PAREN_EXPR: |
359 pp_string (buffer, "(("); | |
360 dump_generic_node (buffer, rhs, spc, flags, false); | |
361 pp_string (buffer, "))"); | |
362 break; | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
363 |
0 | 364 case ABS_EXPR: |
111 | 365 if (flags & TDF_GIMPLE) |
366 { | |
367 pp_string (buffer, "__ABS "); | |
368 dump_generic_node (buffer, rhs, spc, flags, false); | |
369 } | |
370 else | |
371 { | |
372 pp_string (buffer, "ABS_EXPR <"); | |
373 dump_generic_node (buffer, rhs, spc, flags, false); | |
374 pp_greater (buffer); | |
375 } | |
0 | 376 break; |
377 | |
378 default: | |
379 if (TREE_CODE_CLASS (rhs_code) == tcc_declaration | |
380 || TREE_CODE_CLASS (rhs_code) == tcc_constant | |
381 || TREE_CODE_CLASS (rhs_code) == tcc_reference | |
382 || rhs_code == SSA_NAME | |
383 || rhs_code == ADDR_EXPR | |
384 || rhs_code == CONSTRUCTOR) | |
385 { | |
386 dump_generic_node (buffer, rhs, spc, flags, false); | |
387 break; | |
388 } | |
389 else if (rhs_code == BIT_NOT_EXPR) | |
111 | 390 pp_complement (buffer); |
0 | 391 else if (rhs_code == TRUTH_NOT_EXPR) |
111 | 392 pp_exclamation (buffer); |
0 | 393 else if (rhs_code == NEGATE_EXPR) |
111 | 394 pp_minus (buffer); |
0 | 395 else |
396 { | |
111 | 397 pp_left_bracket (buffer); |
398 pp_string (buffer, get_tree_code_name (rhs_code)); | |
0 | 399 pp_string (buffer, "] "); |
400 } | |
401 | |
402 if (op_prio (rhs) < op_code_prio (rhs_code)) | |
403 { | |
111 | 404 pp_left_paren (buffer); |
0 | 405 dump_generic_node (buffer, rhs, spc, flags, false); |
111 | 406 pp_right_paren (buffer); |
0 | 407 } |
408 else | |
409 dump_generic_node (buffer, rhs, spc, flags, false); | |
410 break; | |
411 } | |
412 } | |
413 | |
414 | |
415 /* Helper for dump_gimple_assign. Print the binary RHS of the | |
111 | 416 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */ |
0 | 417 |
418 static void | |
111 | 419 dump_binary_rhs (pretty_printer *buffer, gassign *gs, int spc, |
420 dump_flags_t flags) | |
0 | 421 { |
422 const char *p; | |
423 enum tree_code code = gimple_assign_rhs_code (gs); | |
424 switch (code) | |
425 { | |
426 case COMPLEX_EXPR: | |
427 case MIN_EXPR: | |
428 case MAX_EXPR: | |
429 case VEC_WIDEN_MULT_HI_EXPR: | |
430 case VEC_WIDEN_MULT_LO_EXPR: | |
111 | 431 case VEC_WIDEN_MULT_EVEN_EXPR: |
432 case VEC_WIDEN_MULT_ODD_EXPR: | |
0 | 433 case VEC_PACK_TRUNC_EXPR: |
434 case VEC_PACK_SAT_EXPR: | |
435 case VEC_PACK_FIX_TRUNC_EXPR: | |
111 | 436 case VEC_WIDEN_LSHIFT_HI_EXPR: |
437 case VEC_WIDEN_LSHIFT_LO_EXPR: | |
438 for (p = get_tree_code_name (code); *p; p++) | |
0 | 439 pp_character (buffer, TOUPPER (*p)); |
440 pp_string (buffer, " <"); | |
441 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
442 pp_string (buffer, ", "); | |
443 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
111 | 444 pp_greater (buffer); |
0 | 445 break; |
446 | |
447 default: | |
448 if (op_prio (gimple_assign_rhs1 (gs)) <= op_code_prio (code)) | |
449 { | |
111 | 450 pp_left_paren (buffer); |
0 | 451 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, |
452 false); | |
111 | 453 pp_right_paren (buffer); |
0 | 454 } |
455 else | |
456 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
457 pp_space (buffer); | |
458 pp_string (buffer, op_symbol_code (gimple_assign_rhs_code (gs))); | |
459 pp_space (buffer); | |
460 if (op_prio (gimple_assign_rhs2 (gs)) <= op_code_prio (code)) | |
461 { | |
111 | 462 pp_left_paren (buffer); |
0 | 463 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, |
464 false); | |
111 | 465 pp_right_paren (buffer); |
0 | 466 } |
467 else | |
468 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
469 } | |
470 } | |
471 | |
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
|
472 /* Helper for dump_gimple_assign. Print the ternary RHS of the |
111 | 473 assignment GS. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. */ |
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
|
474 |
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
|
475 static void |
111 | 476 dump_ternary_rhs (pretty_printer *buffer, gassign *gs, int spc, |
477 dump_flags_t flags) | |
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
|
478 { |
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
|
479 const char *p; |
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
|
480 enum tree_code code = gimple_assign_rhs_code (gs); |
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
|
481 switch (code) |
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
|
482 { |
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
|
483 case WIDEN_MULT_PLUS_EXPR: |
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
|
484 case WIDEN_MULT_MINUS_EXPR: |
111 | 485 for (p = get_tree_code_name (code); *p; p++) |
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
|
486 pp_character (buffer, TOUPPER (*p)); |
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
|
487 pp_string (buffer, " <"); |
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
|
488 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); |
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
|
489 pp_string (buffer, ", "); |
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
|
490 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); |
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
|
491 pp_string (buffer, ", "); |
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
|
492 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); |
111 | 493 pp_greater (buffer); |
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
|
494 break; |
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
|
495 |
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
|
496 case FMA_EXPR: |
111 | 497 if (flags & TDF_GIMPLE) |
498 { | |
499 pp_string (buffer, "__FMA ("); | |
500 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
501 pp_comma (buffer); | |
502 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
503 pp_comma (buffer); | |
504 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); | |
505 pp_right_paren (buffer); | |
506 } | |
507 else | |
508 { | |
509 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
510 pp_string (buffer, " * "); | |
511 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
512 pp_string (buffer, " + "); | |
513 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); | |
514 } | |
515 break; | |
516 | |
517 case DOT_PROD_EXPR: | |
518 pp_string (buffer, "DOT_PROD_EXPR <"); | |
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
|
519 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); |
111 | 520 pp_string (buffer, ", "); |
521 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
522 pp_string (buffer, ", "); | |
523 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); | |
524 pp_greater (buffer); | |
525 break; | |
526 | |
527 case SAD_EXPR: | |
528 pp_string (buffer, "SAD_EXPR <"); | |
529 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
530 pp_string (buffer, ", "); | |
531 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
532 pp_string (buffer, ", "); | |
533 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); | |
534 pp_greater (buffer); | |
535 break; | |
536 | |
537 case VEC_PERM_EXPR: | |
538 pp_string (buffer, "VEC_PERM_EXPR <"); | |
539 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
540 pp_string (buffer, ", "); | |
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
|
541 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); |
111 | 542 pp_string (buffer, ", "); |
543 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); | |
544 pp_greater (buffer); | |
545 break; | |
546 | |
547 case REALIGN_LOAD_EXPR: | |
548 pp_string (buffer, "REALIGN_LOAD <"); | |
549 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
550 pp_string (buffer, ", "); | |
551 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
552 pp_string (buffer, ", "); | |
553 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); | |
554 pp_greater (buffer); | |
555 break; | |
556 | |
557 case COND_EXPR: | |
558 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
559 pp_string (buffer, " ? "); | |
560 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
561 pp_string (buffer, " : "); | |
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
|
562 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); |
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
|
563 break; |
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
|
564 |
111 | 565 case VEC_COND_EXPR: |
566 pp_string (buffer, "VEC_COND_EXPR <"); | |
567 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
568 pp_string (buffer, ", "); | |
569 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
570 pp_string (buffer, ", "); | |
571 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); | |
572 pp_greater (buffer); | |
573 break; | |
574 | |
575 case BIT_INSERT_EXPR: | |
576 pp_string (buffer, "BIT_INSERT_EXPR <"); | |
577 dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false); | |
578 pp_string (buffer, ", "); | |
579 dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false); | |
580 pp_string (buffer, ", "); | |
581 dump_generic_node (buffer, gimple_assign_rhs3 (gs), spc, flags, false); | |
582 pp_string (buffer, " ("); | |
583 if (INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_rhs2 (gs)))) | |
584 pp_decimal_int (buffer, | |
585 TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs2 (gs)))); | |
586 else | |
587 dump_generic_node (buffer, | |
588 TYPE_SIZE (TREE_TYPE (gimple_assign_rhs2 (gs))), | |
589 spc, flags, false); | |
590 pp_string (buffer, " bits)>"); | |
591 break; | |
592 | |
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
|
593 default: |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
594 gcc_unreachable (); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
595 } |
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
|
596 } |
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
|
597 |
0 | 598 |
599 /* Dump the gimple assignment GS. BUFFER, SPC and FLAGS are as in | |
111 | 600 pp_gimple_stmt_1. */ |
0 | 601 |
602 static void | |
111 | 603 dump_gimple_assign (pretty_printer *buffer, gassign *gs, int spc, |
604 dump_flags_t flags) | |
0 | 605 { |
606 if (flags & TDF_RAW) | |
607 { | |
111 | 608 tree arg1 = NULL; |
609 tree arg2 = NULL; | |
610 tree arg3 = NULL; | |
611 switch (gimple_num_ops (gs)) | |
612 { | |
613 case 4: | |
614 arg3 = gimple_assign_rhs3 (gs); | |
615 /* FALLTHRU */ | |
616 case 3: | |
617 arg2 = gimple_assign_rhs2 (gs); | |
618 /* FALLTHRU */ | |
619 case 2: | |
620 arg1 = gimple_assign_rhs1 (gs); | |
621 break; | |
622 default: | |
623 gcc_unreachable (); | |
624 } | |
0 | 625 |
111 | 626 dump_gimple_fmt (buffer, spc, flags, "%G <%s, %T, %T, %T, %T>", gs, |
627 get_tree_code_name (gimple_assign_rhs_code (gs)), | |
628 gimple_assign_lhs (gs), arg1, arg2, arg3); | |
0 | 629 } |
630 else | |
631 { | |
632 if (!(flags & TDF_RHS_ONLY)) | |
633 { | |
634 dump_generic_node (buffer, gimple_assign_lhs (gs), spc, flags, false); | |
635 pp_space (buffer); | |
111 | 636 pp_equal (buffer); |
0 | 637 |
638 if (gimple_assign_nontemporal_move_p (gs)) | |
639 pp_string (buffer, "{nt}"); | |
640 | |
641 if (gimple_has_volatile_ops (gs)) | |
642 pp_string (buffer, "{v}"); | |
643 | |
644 pp_space (buffer); | |
645 } | |
646 | |
647 if (gimple_num_ops (gs) == 2) | |
648 dump_unary_rhs (buffer, gs, spc, flags); | |
649 else if (gimple_num_ops (gs) == 3) | |
650 dump_binary_rhs (buffer, gs, spc, flags); | |
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
|
651 else if (gimple_num_ops (gs) == 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
|
652 dump_ternary_rhs (buffer, gs, spc, flags); |
0 | 653 else |
654 gcc_unreachable (); | |
655 if (!(flags & TDF_RHS_ONLY)) | |
111 | 656 pp_semicolon (buffer); |
0 | 657 } |
658 } | |
659 | |
660 | |
661 /* Dump the return statement GS. BUFFER, SPC and FLAGS are as in | |
111 | 662 pp_gimple_stmt_1. */ |
0 | 663 |
664 static void | |
111 | 665 dump_gimple_return (pretty_printer *buffer, greturn *gs, int spc, |
666 dump_flags_t flags) | |
0 | 667 { |
111 | 668 tree t, t2; |
0 | 669 |
670 t = gimple_return_retval (gs); | |
111 | 671 t2 = gimple_return_retbnd (gs); |
0 | 672 if (flags & TDF_RAW) |
111 | 673 dump_gimple_fmt (buffer, spc, flags, "%G <%T %T>", gs, t, t2); |
0 | 674 else |
675 { | |
676 pp_string (buffer, "return"); | |
677 if (t) | |
678 { | |
679 pp_space (buffer); | |
680 dump_generic_node (buffer, t, spc, flags, false); | |
681 } | |
111 | 682 if (t2) |
683 { | |
684 pp_string (buffer, ", "); | |
685 dump_generic_node (buffer, t2, spc, flags, false); | |
686 } | |
0 | 687 pp_semicolon (buffer); |
688 } | |
689 } | |
690 | |
691 | |
692 /* Dump the call arguments for a gimple call. BUFFER, FLAGS are as in | |
693 dump_gimple_call. */ | |
694 | |
695 static void | |
111 | 696 dump_gimple_call_args (pretty_printer *buffer, gcall *gs, dump_flags_t flags) |
0 | 697 { |
111 | 698 size_t i = 0; |
699 | |
700 /* Pretty print first arg to certain internal fns. */ | |
701 if (gimple_call_internal_p (gs)) | |
702 { | |
703 const char *const *enums = NULL; | |
704 unsigned limit = 0; | |
705 | |
706 switch (gimple_call_internal_fn (gs)) | |
707 { | |
708 case IFN_UNIQUE: | |
709 #define DEF(X) #X | |
710 static const char *const unique_args[] = {IFN_UNIQUE_CODES}; | |
711 #undef DEF | |
712 enums = unique_args; | |
713 | |
714 limit = ARRAY_SIZE (unique_args); | |
715 break; | |
716 | |
717 case IFN_GOACC_LOOP: | |
718 #define DEF(X) #X | |
719 static const char *const loop_args[] = {IFN_GOACC_LOOP_CODES}; | |
720 #undef DEF | |
721 enums = loop_args; | |
722 limit = ARRAY_SIZE (loop_args); | |
723 break; | |
0 | 724 |
111 | 725 case IFN_GOACC_REDUCTION: |
726 #define DEF(X) #X | |
727 static const char *const reduction_args[] | |
728 = {IFN_GOACC_REDUCTION_CODES}; | |
729 #undef DEF | |
730 enums = reduction_args; | |
731 limit = ARRAY_SIZE (reduction_args); | |
732 break; | |
733 | |
734 case IFN_ASAN_MARK: | |
735 #define DEF(X) #X | |
736 static const char *const asan_mark_args[] = {IFN_ASAN_MARK_FLAGS}; | |
737 #undef DEF | |
738 enums = asan_mark_args; | |
739 limit = ARRAY_SIZE (asan_mark_args); | |
740 break; | |
741 | |
742 default: | |
743 break; | |
744 } | |
745 if (limit) | |
746 { | |
747 tree arg0 = gimple_call_arg (gs, 0); | |
748 HOST_WIDE_INT v; | |
749 | |
750 if (TREE_CODE (arg0) == INTEGER_CST | |
751 && tree_fits_shwi_p (arg0) | |
752 && (v = tree_to_shwi (arg0)) >= 0 && v < limit) | |
753 { | |
754 i++; | |
755 pp_string (buffer, enums[v]); | |
756 } | |
757 } | |
758 } | |
759 | |
760 for (; i < gimple_call_num_args (gs); i++) | |
0 | 761 { |
111 | 762 if (i) |
763 pp_string (buffer, ", "); | |
0 | 764 dump_generic_node (buffer, gimple_call_arg (gs, i), 0, flags, false); |
765 } | |
766 | |
767 if (gimple_call_va_arg_pack_p (gs)) | |
768 { | |
111 | 769 if (i) |
770 pp_string (buffer, ", "); | |
0 | 771 |
772 pp_string (buffer, "__builtin_va_arg_pack ()"); | |
773 } | |
774 } | |
775 | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
776 /* Dump the points-to solution *PT to BUFFER. */ |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
777 |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
778 static void |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
779 pp_points_to_solution (pretty_printer *buffer, struct pt_solution *pt) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
780 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
781 if (pt->anything) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
782 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
783 pp_string (buffer, "anything "); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
784 return; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
785 } |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
786 if (pt->nonlocal) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
787 pp_string (buffer, "nonlocal "); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
788 if (pt->escaped) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
789 pp_string (buffer, "escaped "); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
790 if (pt->ipa_escaped) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
791 pp_string (buffer, "unit-escaped "); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
792 if (pt->null) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
793 pp_string (buffer, "null "); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
794 if (pt->vars |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
795 && !bitmap_empty_p (pt->vars)) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
796 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
797 bitmap_iterator bi; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
798 unsigned i; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
799 pp_string (buffer, "{ "); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
800 EXECUTE_IF_SET_IN_BITMAP (pt->vars, 0, i, bi) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
801 { |
111 | 802 pp_string (buffer, "D."); |
803 pp_decimal_int (buffer, i); | |
804 pp_space (buffer); | |
805 } | |
806 pp_right_brace (buffer); | |
807 if (pt->vars_contains_nonlocal | |
808 || pt->vars_contains_escaped | |
809 || pt->vars_contains_escaped_heap | |
810 || pt->vars_contains_restrict) | |
811 { | |
812 const char *comma = ""; | |
813 pp_string (buffer, " ("); | |
814 if (pt->vars_contains_nonlocal) | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
815 { |
111 | 816 pp_string (buffer, "nonlocal"); |
817 comma = ", "; | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
818 } |
111 | 819 if (pt->vars_contains_escaped) |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
820 { |
111 | 821 pp_string (buffer, comma); |
822 pp_string (buffer, "escaped"); | |
823 comma = ", "; | |
824 } | |
825 if (pt->vars_contains_escaped_heap) | |
826 { | |
827 pp_string (buffer, comma); | |
828 pp_string (buffer, "escaped heap"); | |
829 comma = ", "; | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
830 } |
111 | 831 if (pt->vars_contains_restrict) |
832 { | |
833 pp_string (buffer, comma); | |
834 pp_string (buffer, "restrict"); | |
835 comma = ", "; | |
836 } | |
837 if (pt->vars_contains_interposable) | |
838 { | |
839 pp_string (buffer, comma); | |
840 pp_string (buffer, "interposable"); | |
841 } | |
842 pp_string (buffer, ")"); | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
843 } |
111 | 844 |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
845 } |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
846 } |
0 | 847 |
848 /* Dump the call statement GS. BUFFER, SPC and FLAGS are as in | |
111 | 849 pp_gimple_stmt_1. */ |
0 | 850 |
851 static void | |
111 | 852 dump_gimple_call (pretty_printer *buffer, gcall *gs, int spc, |
853 dump_flags_t flags) | |
0 | 854 { |
855 tree lhs = gimple_call_lhs (gs); | |
111 | 856 tree fn = gimple_call_fn (gs); |
0 | 857 |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
858 if (flags & TDF_ALIAS) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
859 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
860 struct pt_solution *pt; |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
861 pt = gimple_call_use_set (gs); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
862 if (!pt_solution_empty_p (pt)) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
863 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
864 pp_string (buffer, "# USE = "); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
865 pp_points_to_solution (buffer, pt); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
866 newline_and_indent (buffer, spc); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
867 } |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
868 pt = gimple_call_clobber_set (gs); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
869 if (!pt_solution_empty_p (pt)) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
870 { |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
871 pp_string (buffer, "# CLB = "); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
872 pp_points_to_solution (buffer, pt); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
873 newline_and_indent (buffer, spc); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
874 } |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
875 } |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
876 |
0 | 877 if (flags & TDF_RAW) |
878 { | |
111 | 879 if (gimple_call_internal_p (gs)) |
880 dump_gimple_fmt (buffer, spc, flags, "%G <%s, %T", gs, | |
881 internal_fn_name (gimple_call_internal_fn (gs)), lhs); | |
882 else | |
883 dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T", gs, fn, lhs); | |
0 | 884 if (gimple_call_num_args (gs) > 0) |
885 { | |
886 pp_string (buffer, ", "); | |
887 dump_gimple_call_args (buffer, gs, flags); | |
888 } | |
111 | 889 pp_greater (buffer); |
0 | 890 } |
891 else | |
892 { | |
893 if (lhs && !(flags & TDF_RHS_ONLY)) | |
894 { | |
895 dump_generic_node (buffer, lhs, spc, flags, false); | |
896 pp_string (buffer, " ="); | |
897 | |
898 if (gimple_has_volatile_ops (gs)) | |
899 pp_string (buffer, "{v}"); | |
900 | |
901 pp_space (buffer); | |
902 } | |
111 | 903 if (gimple_call_internal_p (gs)) |
904 pp_string (buffer, internal_fn_name (gimple_call_internal_fn (gs))); | |
905 else | |
906 print_call_name (buffer, fn, flags); | |
0 | 907 pp_string (buffer, " ("); |
908 dump_gimple_call_args (buffer, gs, flags); | |
111 | 909 pp_right_paren (buffer); |
0 | 910 if (!(flags & TDF_RHS_ONLY)) |
911 pp_semicolon (buffer); | |
912 } | |
913 | |
914 if (gimple_call_chain (gs)) | |
915 { | |
916 pp_string (buffer, " [static-chain: "); | |
917 dump_generic_node (buffer, gimple_call_chain (gs), spc, flags, false); | |
111 | 918 pp_right_bracket (buffer); |
0 | 919 } |
920 | |
921 if (gimple_call_return_slot_opt_p (gs)) | |
922 pp_string (buffer, " [return slot optimization]"); | |
923 if (gimple_call_tail_p (gs)) | |
924 pp_string (buffer, " [tail call]"); | |
111 | 925 if (gimple_call_must_tail_p (gs)) |
926 pp_string (buffer, " [must tail call]"); | |
927 | |
928 if (fn == NULL) | |
929 return; | |
930 | |
931 /* Dump the arguments of _ITM_beginTransaction sanely. */ | |
932 if (TREE_CODE (fn) == ADDR_EXPR) | |
933 fn = TREE_OPERAND (fn, 0); | |
934 if (TREE_CODE (fn) == FUNCTION_DECL && decl_is_tm_clone (fn)) | |
935 pp_string (buffer, " [tm-clone]"); | |
936 if (TREE_CODE (fn) == FUNCTION_DECL | |
937 && DECL_BUILT_IN_CLASS (fn) == BUILT_IN_NORMAL | |
938 && DECL_FUNCTION_CODE (fn) == BUILT_IN_TM_START | |
939 && gimple_call_num_args (gs) > 0) | |
940 { | |
941 tree t = gimple_call_arg (gs, 0); | |
942 unsigned HOST_WIDE_INT props; | |
943 gcc_assert (TREE_CODE (t) == INTEGER_CST); | |
944 | |
945 pp_string (buffer, " [ "); | |
946 | |
947 /* Get the transaction code properties. */ | |
948 props = TREE_INT_CST_LOW (t); | |
949 | |
950 if (props & PR_INSTRUMENTEDCODE) | |
951 pp_string (buffer, "instrumentedCode "); | |
952 if (props & PR_UNINSTRUMENTEDCODE) | |
953 pp_string (buffer, "uninstrumentedCode "); | |
954 if (props & PR_HASNOXMMUPDATE) | |
955 pp_string (buffer, "hasNoXMMUpdate "); | |
956 if (props & PR_HASNOABORT) | |
957 pp_string (buffer, "hasNoAbort "); | |
958 if (props & PR_HASNOIRREVOCABLE) | |
959 pp_string (buffer, "hasNoIrrevocable "); | |
960 if (props & PR_DOESGOIRREVOCABLE) | |
961 pp_string (buffer, "doesGoIrrevocable "); | |
962 if (props & PR_HASNOSIMPLEREADS) | |
963 pp_string (buffer, "hasNoSimpleReads "); | |
964 if (props & PR_AWBARRIERSOMITTED) | |
965 pp_string (buffer, "awBarriersOmitted "); | |
966 if (props & PR_RARBARRIERSOMITTED) | |
967 pp_string (buffer, "RaRBarriersOmitted "); | |
968 if (props & PR_UNDOLOGCODE) | |
969 pp_string (buffer, "undoLogCode "); | |
970 if (props & PR_PREFERUNINSTRUMENTED) | |
971 pp_string (buffer, "preferUninstrumented "); | |
972 if (props & PR_EXCEPTIONBLOCK) | |
973 pp_string (buffer, "exceptionBlock "); | |
974 if (props & PR_HASELSE) | |
975 pp_string (buffer, "hasElse "); | |
976 if (props & PR_READONLY) | |
977 pp_string (buffer, "readOnly "); | |
978 | |
979 pp_right_bracket (buffer); | |
980 } | |
0 | 981 } |
982 | |
983 | |
984 /* Dump the switch statement GS. BUFFER, SPC and FLAGS are as in | |
111 | 985 pp_gimple_stmt_1. */ |
0 | 986 |
987 static void | |
111 | 988 dump_gimple_switch (pretty_printer *buffer, gswitch *gs, int spc, |
989 dump_flags_t flags) | |
0 | 990 { |
991 unsigned int i; | |
992 | |
993 GIMPLE_CHECK (gs, GIMPLE_SWITCH); | |
994 if (flags & TDF_RAW) | |
995 dump_gimple_fmt (buffer, spc, flags, "%G <%T, ", gs, | |
996 gimple_switch_index (gs)); | |
997 else | |
998 { | |
999 pp_string (buffer, "switch ("); | |
1000 dump_generic_node (buffer, gimple_switch_index (gs), spc, flags, true); | |
111 | 1001 if (flags & TDF_GIMPLE) |
1002 pp_string (buffer, ") {"); | |
1003 else | |
1004 pp_string (buffer, ") <"); | |
0 | 1005 } |
1006 | |
1007 for (i = 0; i < gimple_switch_num_labels (gs); i++) | |
1008 { | |
1009 tree case_label = gimple_switch_label (gs, i); | |
111 | 1010 gcc_checking_assert (case_label != NULL_TREE); |
0 | 1011 dump_generic_node (buffer, case_label, spc, flags, false); |
111 | 1012 pp_space (buffer); |
1013 tree label = CASE_LABEL (case_label); | |
1014 dump_generic_node (buffer, label, spc, flags, false); | |
1015 | |
1016 if (cfun && cfun->cfg) | |
1017 { | |
1018 basic_block dest = label_to_block (label); | |
1019 if (dest) | |
1020 { | |
1021 edge label_edge = find_edge (gimple_bb (gs), dest); | |
1022 if (label_edge && !(flags & TDF_GIMPLE)) | |
1023 dump_edge_probability (buffer, label_edge); | |
1024 } | |
1025 } | |
1026 | |
0 | 1027 if (i < gimple_switch_num_labels (gs) - 1) |
111 | 1028 { |
1029 if (flags & TDF_GIMPLE) | |
1030 pp_string (buffer, "; "); | |
1031 else | |
1032 pp_string (buffer, ", "); | |
1033 } | |
0 | 1034 } |
111 | 1035 if (flags & TDF_GIMPLE) |
1036 pp_string (buffer, "; }"); | |
1037 else | |
1038 pp_greater (buffer); | |
0 | 1039 } |
1040 | |
1041 | |
1042 /* Dump the gimple conditional GS. BUFFER, SPC and FLAGS are as in | |
111 | 1043 pp_gimple_stmt_1. */ |
0 | 1044 |
1045 static void | |
111 | 1046 dump_gimple_cond (pretty_printer *buffer, gcond *gs, int spc, |
1047 dump_flags_t flags) | |
0 | 1048 { |
1049 if (flags & TDF_RAW) | |
1050 dump_gimple_fmt (buffer, spc, flags, "%G <%s, %T, %T, %T, %T>", gs, | |
111 | 1051 get_tree_code_name (gimple_cond_code (gs)), |
1052 gimple_cond_lhs (gs), gimple_cond_rhs (gs), | |
1053 gimple_cond_true_label (gs), gimple_cond_false_label (gs)); | |
0 | 1054 else |
1055 { | |
1056 if (!(flags & TDF_RHS_ONLY)) | |
1057 pp_string (buffer, "if ("); | |
1058 dump_generic_node (buffer, gimple_cond_lhs (gs), spc, flags, false); | |
1059 pp_space (buffer); | |
1060 pp_string (buffer, op_symbol_code (gimple_cond_code (gs))); | |
1061 pp_space (buffer); | |
1062 dump_generic_node (buffer, gimple_cond_rhs (gs), spc, flags, false); | |
1063 if (!(flags & TDF_RHS_ONLY)) | |
1064 { | |
111 | 1065 edge_iterator ei; |
1066 edge e, true_edge = NULL, false_edge = NULL; | |
1067 basic_block bb = gimple_bb (gs); | |
1068 | |
1069 if (bb) | |
1070 { | |
1071 FOR_EACH_EDGE (e, ei, bb->succs) | |
1072 { | |
1073 if (e->flags & EDGE_TRUE_VALUE) | |
1074 true_edge = e; | |
1075 else if (e->flags & EDGE_FALSE_VALUE) | |
1076 false_edge = e; | |
1077 } | |
1078 } | |
1079 | |
1080 bool has_edge_info = true_edge != NULL && false_edge != NULL; | |
1081 | |
1082 pp_right_paren (buffer); | |
0 | 1083 |
1084 if (gimple_cond_true_label (gs)) | |
1085 { | |
1086 pp_string (buffer, " goto "); | |
1087 dump_generic_node (buffer, gimple_cond_true_label (gs), | |
1088 spc, flags, false); | |
111 | 1089 if (has_edge_info && !(flags & TDF_GIMPLE)) |
1090 dump_edge_probability (buffer, true_edge); | |
0 | 1091 pp_semicolon (buffer); |
1092 } | |
1093 if (gimple_cond_false_label (gs)) | |
1094 { | |
1095 pp_string (buffer, " else goto "); | |
1096 dump_generic_node (buffer, gimple_cond_false_label (gs), | |
1097 spc, flags, false); | |
111 | 1098 if (has_edge_info && !(flags & TDF_GIMPLE)) |
1099 dump_edge_probability (buffer, false_edge); | |
1100 | |
0 | 1101 pp_semicolon (buffer); |
1102 } | |
1103 } | |
1104 } | |
1105 } | |
1106 | |
1107 | |
1108 /* Dump a GIMPLE_LABEL tuple on the pretty_printer BUFFER, SPC | |
1109 spaces of indent. FLAGS specifies details to show in the dump (see | |
111 | 1110 TDF_* in dumpfils.h). */ |
0 | 1111 |
1112 static void | |
111 | 1113 dump_gimple_label (pretty_printer *buffer, glabel *gs, int spc, |
1114 dump_flags_t flags) | |
0 | 1115 { |
1116 tree label = gimple_label_label (gs); | |
1117 if (flags & TDF_RAW) | |
111 | 1118 dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs, label); |
0 | 1119 else |
1120 { | |
1121 dump_generic_node (buffer, label, spc, flags, false); | |
111 | 1122 pp_colon (buffer); |
0 | 1123 } |
111 | 1124 if (flags & TDF_GIMPLE) |
1125 return; | |
0 | 1126 if (DECL_NONLOCAL (label)) |
1127 pp_string (buffer, " [non-local]"); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1128 if ((flags & TDF_EH) && EH_LANDING_PAD_NR (label)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1129 pp_printf (buffer, " [LP %d]", EH_LANDING_PAD_NR (label)); |
0 | 1130 } |
1131 | |
1132 /* Dump a GIMPLE_GOTO tuple on the pretty_printer BUFFER, SPC | |
1133 spaces of indent. FLAGS specifies details to show in the dump (see | |
111 | 1134 TDF_* in dumpfile.h). */ |
0 | 1135 |
1136 static void | |
111 | 1137 dump_gimple_goto (pretty_printer *buffer, ggoto *gs, int spc, |
1138 dump_flags_t flags) | |
0 | 1139 { |
1140 tree label = gimple_goto_dest (gs); | |
1141 if (flags & TDF_RAW) | |
1142 dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs, label); | |
1143 else | |
1144 dump_gimple_fmt (buffer, spc, flags, "goto %T;", label); | |
1145 } | |
1146 | |
1147 | |
1148 /* Dump a GIMPLE_BIND tuple on the pretty_printer BUFFER, SPC | |
1149 spaces of indent. FLAGS specifies details to show in the dump (see | |
111 | 1150 TDF_* in dumpfile.h). */ |
0 | 1151 |
1152 static void | |
111 | 1153 dump_gimple_bind (pretty_printer *buffer, gbind *gs, int spc, |
1154 dump_flags_t flags) | |
0 | 1155 { |
1156 if (flags & TDF_RAW) | |
1157 dump_gimple_fmt (buffer, spc, flags, "%G <", gs); | |
1158 else | |
111 | 1159 pp_left_brace (buffer); |
0 | 1160 if (!(flags & TDF_SLIM)) |
1161 { | |
1162 tree var; | |
1163 | |
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
|
1164 for (var = gimple_bind_vars (gs); var; var = DECL_CHAIN (var)) |
0 | 1165 { |
1166 newline_and_indent (buffer, 2); | |
1167 print_declaration (buffer, var, spc, flags); | |
1168 } | |
1169 if (gimple_bind_vars (gs)) | |
1170 pp_newline (buffer); | |
1171 } | |
1172 pp_newline (buffer); | |
1173 dump_gimple_seq (buffer, gimple_bind_body (gs), spc + 2, flags); | |
1174 newline_and_indent (buffer, spc); | |
1175 if (flags & TDF_RAW) | |
111 | 1176 pp_greater (buffer); |
0 | 1177 else |
111 | 1178 pp_right_brace (buffer); |
0 | 1179 } |
1180 | |
1181 | |
1182 /* Dump a GIMPLE_TRY tuple on the pretty_printer BUFFER, SPC spaces of | |
1183 indent. FLAGS specifies details to show in the dump (see TDF_* in | |
111 | 1184 dumpfile.h). */ |
0 | 1185 |
1186 static void | |
111 | 1187 dump_gimple_try (pretty_printer *buffer, gtry *gs, int spc, |
1188 dump_flags_t flags) | |
0 | 1189 { |
1190 if (flags & TDF_RAW) | |
1191 { | |
1192 const char *type; | |
1193 if (gimple_try_kind (gs) == GIMPLE_TRY_CATCH) | |
1194 type = "GIMPLE_TRY_CATCH"; | |
1195 else if (gimple_try_kind (gs) == GIMPLE_TRY_FINALLY) | |
1196 type = "GIMPLE_TRY_FINALLY"; | |
1197 else | |
1198 type = "UNKNOWN GIMPLE_TRY"; | |
1199 dump_gimple_fmt (buffer, spc, flags, | |
1200 "%G <%s,%+EVAL <%S>%nCLEANUP <%S>%->", gs, type, | |
1201 gimple_try_eval (gs), gimple_try_cleanup (gs)); | |
1202 } | |
1203 else | |
1204 { | |
1205 pp_string (buffer, "try"); | |
1206 newline_and_indent (buffer, spc + 2); | |
111 | 1207 pp_left_brace (buffer); |
0 | 1208 pp_newline (buffer); |
1209 | |
1210 dump_gimple_seq (buffer, gimple_try_eval (gs), spc + 4, flags); | |
1211 newline_and_indent (buffer, spc + 2); | |
111 | 1212 pp_right_brace (buffer); |
0 | 1213 |
1214 if (gimple_try_kind (gs) == GIMPLE_TRY_CATCH) | |
1215 { | |
1216 newline_and_indent (buffer, spc); | |
1217 pp_string (buffer, "catch"); | |
1218 newline_and_indent (buffer, spc + 2); | |
111 | 1219 pp_left_brace (buffer); |
0 | 1220 } |
1221 else if (gimple_try_kind (gs) == GIMPLE_TRY_FINALLY) | |
1222 { | |
1223 newline_and_indent (buffer, spc); | |
1224 pp_string (buffer, "finally"); | |
1225 newline_and_indent (buffer, spc + 2); | |
111 | 1226 pp_left_brace (buffer); |
0 | 1227 } |
1228 else | |
1229 pp_string (buffer, " <UNKNOWN GIMPLE_TRY> {"); | |
1230 | |
1231 pp_newline (buffer); | |
1232 dump_gimple_seq (buffer, gimple_try_cleanup (gs), spc + 4, flags); | |
1233 newline_and_indent (buffer, spc + 2); | |
111 | 1234 pp_right_brace (buffer); |
0 | 1235 } |
1236 } | |
1237 | |
1238 | |
1239 /* Dump a GIMPLE_CATCH tuple on the pretty_printer BUFFER, SPC spaces of | |
1240 indent. FLAGS specifies details to show in the dump (see TDF_* in | |
111 | 1241 dumpfile.h). */ |
0 | 1242 |
1243 static void | |
111 | 1244 dump_gimple_catch (pretty_printer *buffer, gcatch *gs, int spc, |
1245 dump_flags_t flags) | |
0 | 1246 { |
1247 if (flags & TDF_RAW) | |
1248 dump_gimple_fmt (buffer, spc, flags, "%G <%T, %+CATCH <%S>%->", gs, | |
1249 gimple_catch_types (gs), gimple_catch_handler (gs)); | |
1250 else | |
1251 dump_gimple_fmt (buffer, spc, flags, "catch (%T)%+{%S}", | |
1252 gimple_catch_types (gs), gimple_catch_handler (gs)); | |
1253 } | |
1254 | |
1255 | |
1256 /* Dump a GIMPLE_EH_FILTER tuple on the pretty_printer BUFFER, SPC spaces of | |
1257 indent. FLAGS specifies details to show in the dump (see TDF_* in | |
111 | 1258 dumpfile.h). */ |
0 | 1259 |
1260 static void | |
111 | 1261 dump_gimple_eh_filter (pretty_printer *buffer, geh_filter *gs, int spc, |
1262 dump_flags_t flags) | |
0 | 1263 { |
1264 if (flags & TDF_RAW) | |
1265 dump_gimple_fmt (buffer, spc, flags, "%G <%T, %+FAILURE <%S>%->", gs, | |
1266 gimple_eh_filter_types (gs), | |
1267 gimple_eh_filter_failure (gs)); | |
1268 else | |
1269 dump_gimple_fmt (buffer, spc, flags, "<<<eh_filter (%T)>>>%+{%+%S%-}", | |
1270 gimple_eh_filter_types (gs), | |
1271 gimple_eh_filter_failure (gs)); | |
1272 } | |
1273 | |
1274 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1275 /* Dump a GIMPLE_EH_MUST_NOT_THROW tuple. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1276 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1277 static void |
111 | 1278 dump_gimple_eh_must_not_throw (pretty_printer *buffer, |
1279 geh_mnt *gs, int spc, dump_flags_t flags) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1280 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1281 if (flags & TDF_RAW) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1282 dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1283 gimple_eh_must_not_throw_fndecl (gs)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1284 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1285 dump_gimple_fmt (buffer, spc, flags, "<<<eh_must_not_throw (%T)>>>", |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1286 gimple_eh_must_not_throw_fndecl (gs)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1287 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1288 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1289 |
111 | 1290 /* Dump a GIMPLE_EH_ELSE tuple on the pretty_printer BUFFER, SPC spaces of |
1291 indent. FLAGS specifies details to show in the dump (see TDF_* in | |
1292 dumpfile.h). */ | |
1293 | |
1294 static void | |
1295 dump_gimple_eh_else (pretty_printer *buffer, geh_else *gs, int spc, | |
1296 dump_flags_t flags) | |
1297 { | |
1298 if (flags & TDF_RAW) | |
1299 dump_gimple_fmt (buffer, spc, flags, | |
1300 "%G <%+N_BODY <%S>%nE_BODY <%S>%->", gs, | |
1301 gimple_eh_else_n_body (gs), gimple_eh_else_e_body (gs)); | |
1302 else | |
1303 dump_gimple_fmt (buffer, spc, flags, | |
1304 "<<<if_normal_exit>>>%+{%S}%-<<<else_eh_exit>>>%+{%S}", | |
1305 gimple_eh_else_n_body (gs), gimple_eh_else_e_body (gs)); | |
1306 } | |
1307 | |
1308 | |
0 | 1309 /* Dump a GIMPLE_RESX tuple on the pretty_printer BUFFER, SPC spaces of |
1310 indent. FLAGS specifies details to show in the dump (see TDF_* in | |
111 | 1311 dumpfile.h). */ |
0 | 1312 |
1313 static void | |
111 | 1314 dump_gimple_resx (pretty_printer *buffer, gresx *gs, int spc, |
1315 dump_flags_t flags) | |
0 | 1316 { |
1317 if (flags & TDF_RAW) | |
1318 dump_gimple_fmt (buffer, spc, flags, "%G <%d>", gs, | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1319 gimple_resx_region (gs)); |
0 | 1320 else |
1321 dump_gimple_fmt (buffer, spc, flags, "resx %d", gimple_resx_region (gs)); | |
1322 } | |
1323 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1324 /* Dump a GIMPLE_EH_DISPATCH tuple on the pretty_printer BUFFER. */ |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1325 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1326 static void |
111 | 1327 dump_gimple_eh_dispatch (pretty_printer *buffer, geh_dispatch *gs, int spc, |
1328 dump_flags_t flags) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1329 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1330 if (flags & TDF_RAW) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1331 dump_gimple_fmt (buffer, spc, flags, "%G <%d>", gs, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1332 gimple_eh_dispatch_region (gs)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1333 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1334 dump_gimple_fmt (buffer, spc, flags, "eh_dispatch %d", |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1335 gimple_eh_dispatch_region (gs)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1336 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1337 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1338 /* Dump a GIMPLE_DEBUG tuple on the pretty_printer BUFFER, SPC spaces |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1339 of indent. FLAGS specifies details to show in the dump (see TDF_* |
111 | 1340 in dumpfile.h). */ |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1341 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1342 static void |
111 | 1343 dump_gimple_debug (pretty_printer *buffer, gdebug *gs, int spc, |
1344 dump_flags_t flags) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1345 { |
111 | 1346 switch (gs->subcode) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1347 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1348 case GIMPLE_DEBUG_BIND: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1349 if (flags & TDF_RAW) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1350 dump_gimple_fmt (buffer, spc, flags, "%G BIND <%T, %T>", gs, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1351 gimple_debug_bind_get_var (gs), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1352 gimple_debug_bind_get_value (gs)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1353 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1354 dump_gimple_fmt (buffer, spc, flags, "# DEBUG %T => %T", |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1355 gimple_debug_bind_get_var (gs), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1356 gimple_debug_bind_get_value (gs)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1357 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1358 |
111 | 1359 case GIMPLE_DEBUG_SOURCE_BIND: |
1360 if (flags & TDF_RAW) | |
1361 dump_gimple_fmt (buffer, spc, flags, "%G SRCBIND <%T, %T>", gs, | |
1362 gimple_debug_source_bind_get_var (gs), | |
1363 gimple_debug_source_bind_get_value (gs)); | |
1364 else | |
1365 dump_gimple_fmt (buffer, spc, flags, "# DEBUG %T s=> %T", | |
1366 gimple_debug_source_bind_get_var (gs), | |
1367 gimple_debug_source_bind_get_value (gs)); | |
1368 break; | |
1369 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1370 default: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1371 gcc_unreachable (); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1372 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1373 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1374 |
0 | 1375 /* Dump a GIMPLE_OMP_FOR tuple on the pretty_printer BUFFER. */ |
1376 static void | |
111 | 1377 dump_gimple_omp_for (pretty_printer *buffer, gomp_for *gs, int spc, |
1378 dump_flags_t flags) | |
0 | 1379 { |
1380 size_t i; | |
1381 | |
1382 if (flags & TDF_RAW) | |
1383 { | |
111 | 1384 const char *kind; |
1385 switch (gimple_omp_for_kind (gs)) | |
1386 { | |
1387 case GF_OMP_FOR_KIND_FOR: | |
1388 kind = ""; | |
1389 break; | |
1390 case GF_OMP_FOR_KIND_DISTRIBUTE: | |
1391 kind = " distribute"; | |
1392 break; | |
1393 case GF_OMP_FOR_KIND_TASKLOOP: | |
1394 kind = " taskloop"; | |
1395 break; | |
1396 case GF_OMP_FOR_KIND_CILKFOR: | |
1397 kind = " _Cilk_for"; | |
1398 break; | |
1399 case GF_OMP_FOR_KIND_OACC_LOOP: | |
1400 kind = " oacc_loop"; | |
1401 break; | |
1402 case GF_OMP_FOR_KIND_SIMD: | |
1403 kind = " simd"; | |
1404 break; | |
1405 case GF_OMP_FOR_KIND_CILKSIMD: | |
1406 kind = " cilksimd"; | |
1407 break; | |
1408 default: | |
1409 gcc_unreachable (); | |
1410 } | |
1411 dump_gimple_fmt (buffer, spc, flags, "%G%s <%+BODY <%S>%nCLAUSES <", gs, | |
1412 kind, gimple_omp_body (gs)); | |
0 | 1413 dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags); |
1414 dump_gimple_fmt (buffer, spc, flags, " >,"); | |
1415 for (i = 0; i < gimple_omp_for_collapse (gs); i++) | |
1416 dump_gimple_fmt (buffer, spc, flags, | |
1417 "%+%T, %T, %T, %s, %T,%n", | |
1418 gimple_omp_for_index (gs, i), | |
1419 gimple_omp_for_initial (gs, i), | |
1420 gimple_omp_for_final (gs, i), | |
111 | 1421 get_tree_code_name (gimple_omp_for_cond (gs, i)), |
0 | 1422 gimple_omp_for_incr (gs, i)); |
1423 dump_gimple_fmt (buffer, spc, flags, "PRE_BODY <%S>%->", | |
1424 gimple_omp_for_pre_body (gs)); | |
1425 } | |
1426 else | |
1427 { | |
111 | 1428 switch (gimple_omp_for_kind (gs)) |
1429 { | |
1430 case GF_OMP_FOR_KIND_FOR: | |
1431 pp_string (buffer, "#pragma omp for"); | |
1432 break; | |
1433 case GF_OMP_FOR_KIND_DISTRIBUTE: | |
1434 pp_string (buffer, "#pragma omp distribute"); | |
1435 break; | |
1436 case GF_OMP_FOR_KIND_TASKLOOP: | |
1437 pp_string (buffer, "#pragma omp taskloop"); | |
1438 break; | |
1439 case GF_OMP_FOR_KIND_CILKFOR: | |
1440 break; | |
1441 case GF_OMP_FOR_KIND_OACC_LOOP: | |
1442 pp_string (buffer, "#pragma acc loop"); | |
1443 break; | |
1444 case GF_OMP_FOR_KIND_SIMD: | |
1445 pp_string (buffer, "#pragma omp simd"); | |
1446 break; | |
1447 case GF_OMP_FOR_KIND_CILKSIMD: | |
1448 pp_string (buffer, "#pragma simd"); | |
1449 break; | |
1450 case GF_OMP_FOR_KIND_GRID_LOOP: | |
1451 pp_string (buffer, "#pragma omp for grid_loop"); | |
1452 break; | |
1453 default: | |
1454 gcc_unreachable (); | |
1455 } | |
1456 if (gimple_omp_for_kind (gs) != GF_OMP_FOR_KIND_CILKFOR) | |
1457 dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags); | |
0 | 1458 for (i = 0; i < gimple_omp_for_collapse (gs); i++) |
1459 { | |
1460 if (i) | |
1461 spc += 2; | |
111 | 1462 if (gimple_omp_for_kind (gs) == GF_OMP_FOR_KIND_CILKFOR) |
1463 pp_string (buffer, "_Cilk_for ("); | |
1464 else | |
1465 { | |
1466 newline_and_indent (buffer, spc); | |
1467 pp_string (buffer, "for ("); | |
1468 } | |
0 | 1469 dump_generic_node (buffer, gimple_omp_for_index (gs, i), spc, |
1470 flags, false); | |
1471 pp_string (buffer, " = "); | |
1472 dump_generic_node (buffer, gimple_omp_for_initial (gs, i), spc, | |
1473 flags, false); | |
1474 pp_string (buffer, "; "); | |
1475 | |
1476 dump_generic_node (buffer, gimple_omp_for_index (gs, i), spc, | |
1477 flags, false); | |
1478 pp_space (buffer); | |
1479 switch (gimple_omp_for_cond (gs, i)) | |
1480 { | |
1481 case LT_EXPR: | |
111 | 1482 pp_less (buffer); |
0 | 1483 break; |
1484 case GT_EXPR: | |
111 | 1485 pp_greater (buffer); |
0 | 1486 break; |
1487 case LE_EXPR: | |
111 | 1488 pp_less_equal (buffer); |
0 | 1489 break; |
1490 case GE_EXPR: | |
111 | 1491 pp_greater_equal (buffer); |
1492 break; | |
1493 case NE_EXPR: | |
1494 pp_string (buffer, "!="); | |
0 | 1495 break; |
1496 default: | |
1497 gcc_unreachable (); | |
1498 } | |
1499 pp_space (buffer); | |
1500 dump_generic_node (buffer, gimple_omp_for_final (gs, i), spc, | |
1501 flags, false); | |
1502 pp_string (buffer, "; "); | |
1503 | |
1504 dump_generic_node (buffer, gimple_omp_for_index (gs, i), spc, | |
1505 flags, false); | |
1506 pp_string (buffer, " = "); | |
1507 dump_generic_node (buffer, gimple_omp_for_incr (gs, i), spc, | |
1508 flags, false); | |
111 | 1509 pp_right_paren (buffer); |
0 | 1510 } |
1511 | |
1512 if (!gimple_seq_empty_p (gimple_omp_body (gs))) | |
1513 { | |
111 | 1514 if (gimple_omp_for_kind (gs) == GF_OMP_FOR_KIND_CILKFOR) |
1515 dump_omp_clauses (buffer, gimple_omp_for_clauses (gs), spc, flags); | |
0 | 1516 newline_and_indent (buffer, spc + 2); |
111 | 1517 pp_left_brace (buffer); |
0 | 1518 pp_newline (buffer); |
1519 dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags); | |
1520 newline_and_indent (buffer, spc + 2); | |
111 | 1521 pp_right_brace (buffer); |
0 | 1522 } |
1523 } | |
1524 } | |
1525 | |
1526 /* Dump a GIMPLE_OMP_CONTINUE tuple on the pretty_printer BUFFER. */ | |
1527 | |
1528 static void | |
111 | 1529 dump_gimple_omp_continue (pretty_printer *buffer, gomp_continue *gs, |
1530 int spc, dump_flags_t flags) | |
0 | 1531 { |
1532 if (flags & TDF_RAW) | |
1533 { | |
1534 dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T>", gs, | |
1535 gimple_omp_continue_control_def (gs), | |
1536 gimple_omp_continue_control_use (gs)); | |
1537 } | |
1538 else | |
1539 { | |
1540 pp_string (buffer, "#pragma omp continue ("); | |
1541 dump_generic_node (buffer, gimple_omp_continue_control_def (gs), | |
1542 spc, flags, false); | |
111 | 1543 pp_comma (buffer); |
0 | 1544 pp_space (buffer); |
1545 dump_generic_node (buffer, gimple_omp_continue_control_use (gs), | |
1546 spc, flags, false); | |
111 | 1547 pp_right_paren (buffer); |
0 | 1548 } |
1549 } | |
1550 | |
1551 /* Dump a GIMPLE_OMP_SINGLE tuple on the pretty_printer BUFFER. */ | |
1552 | |
1553 static void | |
111 | 1554 dump_gimple_omp_single (pretty_printer *buffer, gomp_single *gs, |
1555 int spc, dump_flags_t flags) | |
0 | 1556 { |
1557 if (flags & TDF_RAW) | |
1558 { | |
1559 dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S>%nCLAUSES <", gs, | |
1560 gimple_omp_body (gs)); | |
1561 dump_omp_clauses (buffer, gimple_omp_single_clauses (gs), spc, flags); | |
1562 dump_gimple_fmt (buffer, spc, flags, " >"); | |
1563 } | |
1564 else | |
1565 { | |
1566 pp_string (buffer, "#pragma omp single"); | |
1567 dump_omp_clauses (buffer, gimple_omp_single_clauses (gs), spc, flags); | |
1568 if (!gimple_seq_empty_p (gimple_omp_body (gs))) | |
1569 { | |
1570 newline_and_indent (buffer, spc + 2); | |
111 | 1571 pp_left_brace (buffer); |
1572 pp_newline (buffer); | |
1573 dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags); | |
1574 newline_and_indent (buffer, spc + 2); | |
1575 pp_right_brace (buffer); | |
1576 } | |
1577 } | |
1578 } | |
1579 | |
1580 /* Dump a GIMPLE_OMP_TARGET tuple on the pretty_printer BUFFER. */ | |
1581 | |
1582 static void | |
1583 dump_gimple_omp_target (pretty_printer *buffer, gomp_target *gs, | |
1584 int spc, dump_flags_t flags) | |
1585 { | |
1586 const char *kind; | |
1587 switch (gimple_omp_target_kind (gs)) | |
1588 { | |
1589 case GF_OMP_TARGET_KIND_REGION: | |
1590 kind = ""; | |
1591 break; | |
1592 case GF_OMP_TARGET_KIND_DATA: | |
1593 kind = " data"; | |
1594 break; | |
1595 case GF_OMP_TARGET_KIND_UPDATE: | |
1596 kind = " update"; | |
1597 break; | |
1598 case GF_OMP_TARGET_KIND_ENTER_DATA: | |
1599 kind = " enter data"; | |
1600 break; | |
1601 case GF_OMP_TARGET_KIND_EXIT_DATA: | |
1602 kind = " exit data"; | |
1603 break; | |
1604 case GF_OMP_TARGET_KIND_OACC_KERNELS: | |
1605 kind = " oacc_kernels"; | |
1606 break; | |
1607 case GF_OMP_TARGET_KIND_OACC_PARALLEL: | |
1608 kind = " oacc_parallel"; | |
1609 break; | |
1610 case GF_OMP_TARGET_KIND_OACC_DATA: | |
1611 kind = " oacc_data"; | |
1612 break; | |
1613 case GF_OMP_TARGET_KIND_OACC_UPDATE: | |
1614 kind = " oacc_update"; | |
1615 break; | |
1616 case GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA: | |
1617 kind = " oacc_enter_exit_data"; | |
1618 break; | |
1619 case GF_OMP_TARGET_KIND_OACC_DECLARE: | |
1620 kind = " oacc_declare"; | |
1621 break; | |
1622 case GF_OMP_TARGET_KIND_OACC_HOST_DATA: | |
1623 kind = " oacc_host_data"; | |
1624 break; | |
1625 default: | |
1626 gcc_unreachable (); | |
1627 } | |
1628 if (flags & TDF_RAW) | |
1629 { | |
1630 dump_gimple_fmt (buffer, spc, flags, "%G%s <%+BODY <%S>%nCLAUSES <", gs, | |
1631 kind, gimple_omp_body (gs)); | |
1632 dump_omp_clauses (buffer, gimple_omp_target_clauses (gs), spc, flags); | |
1633 dump_gimple_fmt (buffer, spc, flags, " >, %T, %T%n>", | |
1634 gimple_omp_target_child_fn (gs), | |
1635 gimple_omp_target_data_arg (gs)); | |
1636 } | |
1637 else | |
1638 { | |
1639 pp_string (buffer, "#pragma omp target"); | |
1640 pp_string (buffer, kind); | |
1641 dump_omp_clauses (buffer, gimple_omp_target_clauses (gs), spc, flags); | |
1642 if (gimple_omp_target_child_fn (gs)) | |
1643 { | |
1644 pp_string (buffer, " [child fn: "); | |
1645 dump_generic_node (buffer, gimple_omp_target_child_fn (gs), | |
1646 spc, flags, false); | |
1647 pp_string (buffer, " ("); | |
1648 if (gimple_omp_target_data_arg (gs)) | |
1649 dump_generic_node (buffer, gimple_omp_target_data_arg (gs), | |
1650 spc, flags, false); | |
1651 else | |
1652 pp_string (buffer, "???"); | |
1653 pp_string (buffer, ")]"); | |
1654 } | |
1655 gimple_seq body = gimple_omp_body (gs); | |
1656 if (body && gimple_code (gimple_seq_first_stmt (body)) != GIMPLE_BIND) | |
1657 { | |
1658 newline_and_indent (buffer, spc + 2); | |
1659 pp_left_brace (buffer); | |
1660 pp_newline (buffer); | |
1661 dump_gimple_seq (buffer, body, spc + 4, flags); | |
1662 newline_and_indent (buffer, spc + 2); | |
1663 pp_right_brace (buffer); | |
1664 } | |
1665 else if (body) | |
1666 { | |
1667 pp_newline (buffer); | |
1668 dump_gimple_seq (buffer, body, spc + 2, flags); | |
1669 } | |
1670 } | |
1671 } | |
1672 | |
1673 /* Dump a GIMPLE_OMP_TEAMS tuple on the pretty_printer BUFFER. */ | |
1674 | |
1675 static void | |
1676 dump_gimple_omp_teams (pretty_printer *buffer, gomp_teams *gs, int spc, | |
1677 dump_flags_t flags) | |
1678 { | |
1679 if (flags & TDF_RAW) | |
1680 { | |
1681 dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S>%nCLAUSES <", gs, | |
1682 gimple_omp_body (gs)); | |
1683 dump_omp_clauses (buffer, gimple_omp_teams_clauses (gs), spc, flags); | |
1684 dump_gimple_fmt (buffer, spc, flags, " >"); | |
1685 } | |
1686 else | |
1687 { | |
1688 pp_string (buffer, "#pragma omp teams"); | |
1689 dump_omp_clauses (buffer, gimple_omp_teams_clauses (gs), spc, flags); | |
1690 if (!gimple_seq_empty_p (gimple_omp_body (gs))) | |
1691 { | |
1692 newline_and_indent (buffer, spc + 2); | |
0 | 1693 pp_character (buffer, '{'); |
1694 pp_newline (buffer); | |
1695 dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags); | |
1696 newline_and_indent (buffer, spc + 2); | |
1697 pp_character (buffer, '}'); | |
1698 } | |
1699 } | |
1700 } | |
1701 | |
1702 /* Dump a GIMPLE_OMP_SECTIONS tuple on the pretty_printer BUFFER. */ | |
1703 | |
1704 static void | |
111 | 1705 dump_gimple_omp_sections (pretty_printer *buffer, gomp_sections *gs, |
1706 int spc, dump_flags_t flags) | |
0 | 1707 { |
1708 if (flags & TDF_RAW) | |
1709 { | |
1710 dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S>%nCLAUSES <", gs, | |
1711 gimple_omp_body (gs)); | |
1712 dump_omp_clauses (buffer, gimple_omp_sections_clauses (gs), spc, flags); | |
1713 dump_gimple_fmt (buffer, spc, flags, " >"); | |
1714 } | |
1715 else | |
1716 { | |
1717 pp_string (buffer, "#pragma omp sections"); | |
1718 if (gimple_omp_sections_control (gs)) | |
1719 { | |
1720 pp_string (buffer, " <"); | |
1721 dump_generic_node (buffer, gimple_omp_sections_control (gs), spc, | |
1722 flags, false); | |
111 | 1723 pp_greater (buffer); |
0 | 1724 } |
1725 dump_omp_clauses (buffer, gimple_omp_sections_clauses (gs), spc, flags); | |
1726 if (!gimple_seq_empty_p (gimple_omp_body (gs))) | |
1727 { | |
1728 newline_and_indent (buffer, spc + 2); | |
111 | 1729 pp_left_brace (buffer); |
0 | 1730 pp_newline (buffer); |
1731 dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags); | |
1732 newline_and_indent (buffer, spc + 2); | |
111 | 1733 pp_right_brace (buffer); |
0 | 1734 } |
1735 } | |
1736 } | |
1737 | |
111 | 1738 /* Dump a GIMPLE_OMP_{MASTER,TASKGROUP,ORDERED,SECTION} tuple on the |
1739 pretty_printer BUFFER. */ | |
0 | 1740 |
1741 static void | |
111 | 1742 dump_gimple_omp_block (pretty_printer *buffer, gimple *gs, int spc, |
1743 dump_flags_t flags) | |
0 | 1744 { |
1745 if (flags & TDF_RAW) | |
1746 dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs, | |
1747 gimple_omp_body (gs)); | |
1748 else | |
1749 { | |
1750 switch (gimple_code (gs)) | |
1751 { | |
1752 case GIMPLE_OMP_MASTER: | |
1753 pp_string (buffer, "#pragma omp master"); | |
1754 break; | |
111 | 1755 case GIMPLE_OMP_TASKGROUP: |
1756 pp_string (buffer, "#pragma omp taskgroup"); | |
0 | 1757 break; |
1758 case GIMPLE_OMP_SECTION: | |
1759 pp_string (buffer, "#pragma omp section"); | |
1760 break; | |
111 | 1761 case GIMPLE_OMP_GRID_BODY: |
1762 pp_string (buffer, "#pragma omp gridified body"); | |
1763 break; | |
0 | 1764 default: |
1765 gcc_unreachable (); | |
1766 } | |
1767 if (!gimple_seq_empty_p (gimple_omp_body (gs))) | |
1768 { | |
1769 newline_and_indent (buffer, spc + 2); | |
111 | 1770 pp_left_brace (buffer); |
0 | 1771 pp_newline (buffer); |
1772 dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags); | |
1773 newline_and_indent (buffer, spc + 2); | |
111 | 1774 pp_right_brace (buffer); |
0 | 1775 } |
1776 } | |
1777 } | |
1778 | |
1779 /* Dump a GIMPLE_OMP_CRITICAL tuple on the pretty_printer BUFFER. */ | |
1780 | |
1781 static void | |
111 | 1782 dump_gimple_omp_critical (pretty_printer *buffer, gomp_critical *gs, |
1783 int spc, dump_flags_t flags) | |
0 | 1784 { |
1785 if (flags & TDF_RAW) | |
1786 dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs, | |
1787 gimple_omp_body (gs)); | |
1788 else | |
1789 { | |
1790 pp_string (buffer, "#pragma omp critical"); | |
1791 if (gimple_omp_critical_name (gs)) | |
1792 { | |
1793 pp_string (buffer, " ("); | |
1794 dump_generic_node (buffer, gimple_omp_critical_name (gs), spc, | |
1795 flags, false); | |
111 | 1796 pp_right_paren (buffer); |
0 | 1797 } |
111 | 1798 dump_omp_clauses (buffer, gimple_omp_critical_clauses (gs), spc, flags); |
0 | 1799 if (!gimple_seq_empty_p (gimple_omp_body (gs))) |
1800 { | |
1801 newline_and_indent (buffer, spc + 2); | |
111 | 1802 pp_left_brace (buffer); |
0 | 1803 pp_newline (buffer); |
1804 dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags); | |
1805 newline_and_indent (buffer, spc + 2); | |
111 | 1806 pp_right_brace (buffer); |
1807 } | |
1808 } | |
1809 } | |
1810 | |
1811 /* Dump a GIMPLE_OMP_ORDERED tuple on the pretty_printer BUFFER. */ | |
1812 | |
1813 static void | |
1814 dump_gimple_omp_ordered (pretty_printer *buffer, gomp_ordered *gs, | |
1815 int spc, dump_flags_t flags) | |
1816 { | |
1817 if (flags & TDF_RAW) | |
1818 dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S> >", gs, | |
1819 gimple_omp_body (gs)); | |
1820 else | |
1821 { | |
1822 pp_string (buffer, "#pragma omp ordered"); | |
1823 dump_omp_clauses (buffer, gimple_omp_ordered_clauses (gs), spc, flags); | |
1824 if (!gimple_seq_empty_p (gimple_omp_body (gs))) | |
1825 { | |
1826 newline_and_indent (buffer, spc + 2); | |
1827 pp_left_brace (buffer); | |
1828 pp_newline (buffer); | |
1829 dump_gimple_seq (buffer, gimple_omp_body (gs), spc + 4, flags); | |
1830 newline_and_indent (buffer, spc + 2); | |
1831 pp_right_brace (buffer); | |
0 | 1832 } |
1833 } | |
1834 } | |
1835 | |
1836 /* Dump a GIMPLE_OMP_RETURN tuple on the pretty_printer BUFFER. */ | |
1837 | |
1838 static void | |
111 | 1839 dump_gimple_omp_return (pretty_printer *buffer, gimple *gs, int spc, |
1840 dump_flags_t flags) | |
0 | 1841 { |
1842 if (flags & TDF_RAW) | |
1843 { | |
111 | 1844 dump_gimple_fmt (buffer, spc, flags, "%G <nowait=%d", gs, |
0 | 1845 (int) gimple_omp_return_nowait_p (gs)); |
111 | 1846 if (gimple_omp_return_lhs (gs)) |
1847 dump_gimple_fmt (buffer, spc, flags, ", lhs=%T>", | |
1848 gimple_omp_return_lhs (gs)); | |
1849 else | |
1850 dump_gimple_fmt (buffer, spc, flags, ">"); | |
0 | 1851 } |
1852 else | |
1853 { | |
1854 pp_string (buffer, "#pragma omp return"); | |
1855 if (gimple_omp_return_nowait_p (gs)) | |
1856 pp_string (buffer, "(nowait)"); | |
111 | 1857 if (gimple_omp_return_lhs (gs)) |
1858 { | |
1859 pp_string (buffer, " (set "); | |
1860 dump_generic_node (buffer, gimple_omp_return_lhs (gs), | |
1861 spc, flags, false); | |
1862 pp_character (buffer, ')'); | |
1863 } | |
1864 } | |
1865 } | |
1866 | |
1867 /* Dump a GIMPLE_TRANSACTION tuple on the pretty_printer BUFFER. */ | |
1868 | |
1869 static void | |
1870 dump_gimple_transaction (pretty_printer *buffer, gtransaction *gs, | |
1871 int spc, dump_flags_t flags) | |
1872 { | |
1873 unsigned subcode = gimple_transaction_subcode (gs); | |
1874 | |
1875 if (flags & TDF_RAW) | |
1876 { | |
1877 dump_gimple_fmt (buffer, spc, flags, | |
1878 "%G [SUBCODE=%x,NORM=%T,UNINST=%T,OVER=%T] " | |
1879 "<%+BODY <%S> >", | |
1880 gs, subcode, gimple_transaction_label_norm (gs), | |
1881 gimple_transaction_label_uninst (gs), | |
1882 gimple_transaction_label_over (gs), | |
1883 gimple_transaction_body (gs)); | |
1884 } | |
1885 else | |
1886 { | |
1887 if (subcode & GTMA_IS_OUTER) | |
1888 pp_string (buffer, "__transaction_atomic [[outer]]"); | |
1889 else if (subcode & GTMA_IS_RELAXED) | |
1890 pp_string (buffer, "__transaction_relaxed"); | |
1891 else | |
1892 pp_string (buffer, "__transaction_atomic"); | |
1893 subcode &= ~GTMA_DECLARATION_MASK; | |
1894 | |
1895 if (gimple_transaction_body (gs)) | |
1896 { | |
1897 newline_and_indent (buffer, spc + 2); | |
1898 pp_left_brace (buffer); | |
1899 pp_newline (buffer); | |
1900 dump_gimple_seq (buffer, gimple_transaction_body (gs), | |
1901 spc + 4, flags); | |
1902 newline_and_indent (buffer, spc + 2); | |
1903 pp_right_brace (buffer); | |
1904 } | |
1905 else | |
1906 { | |
1907 pp_string (buffer, " //"); | |
1908 if (gimple_transaction_label_norm (gs)) | |
1909 { | |
1910 pp_string (buffer, " NORM="); | |
1911 dump_generic_node (buffer, gimple_transaction_label_norm (gs), | |
1912 spc, flags, false); | |
1913 } | |
1914 if (gimple_transaction_label_uninst (gs)) | |
1915 { | |
1916 pp_string (buffer, " UNINST="); | |
1917 dump_generic_node (buffer, gimple_transaction_label_uninst (gs), | |
1918 spc, flags, false); | |
1919 } | |
1920 if (gimple_transaction_label_over (gs)) | |
1921 { | |
1922 pp_string (buffer, " OVER="); | |
1923 dump_generic_node (buffer, gimple_transaction_label_over (gs), | |
1924 spc, flags, false); | |
1925 } | |
1926 if (subcode) | |
1927 { | |
1928 pp_string (buffer, " SUBCODE=[ "); | |
1929 if (subcode & GTMA_HAVE_ABORT) | |
1930 { | |
1931 pp_string (buffer, "GTMA_HAVE_ABORT "); | |
1932 subcode &= ~GTMA_HAVE_ABORT; | |
1933 } | |
1934 if (subcode & GTMA_HAVE_LOAD) | |
1935 { | |
1936 pp_string (buffer, "GTMA_HAVE_LOAD "); | |
1937 subcode &= ~GTMA_HAVE_LOAD; | |
1938 } | |
1939 if (subcode & GTMA_HAVE_STORE) | |
1940 { | |
1941 pp_string (buffer, "GTMA_HAVE_STORE "); | |
1942 subcode &= ~GTMA_HAVE_STORE; | |
1943 } | |
1944 if (subcode & GTMA_MAY_ENTER_IRREVOCABLE) | |
1945 { | |
1946 pp_string (buffer, "GTMA_MAY_ENTER_IRREVOCABLE "); | |
1947 subcode &= ~GTMA_MAY_ENTER_IRREVOCABLE; | |
1948 } | |
1949 if (subcode & GTMA_DOES_GO_IRREVOCABLE) | |
1950 { | |
1951 pp_string (buffer, "GTMA_DOES_GO_IRREVOCABLE "); | |
1952 subcode &= ~GTMA_DOES_GO_IRREVOCABLE; | |
1953 } | |
1954 if (subcode & GTMA_HAS_NO_INSTRUMENTATION) | |
1955 { | |
1956 pp_string (buffer, "GTMA_HAS_NO_INSTRUMENTATION "); | |
1957 subcode &= ~GTMA_HAS_NO_INSTRUMENTATION; | |
1958 } | |
1959 if (subcode) | |
1960 pp_printf (buffer, "0x%x ", subcode); | |
1961 pp_right_bracket (buffer); | |
1962 } | |
1963 } | |
0 | 1964 } |
1965 } | |
1966 | |
1967 /* Dump a GIMPLE_ASM tuple on the pretty_printer BUFFER, SPC spaces of | |
1968 indent. FLAGS specifies details to show in the dump (see TDF_* in | |
111 | 1969 dumpfile.h). */ |
0 | 1970 |
1971 static void | |
111 | 1972 dump_gimple_asm (pretty_printer *buffer, gasm *gs, int spc, dump_flags_t flags) |
0 | 1973 { |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1974 unsigned int i, n, f, fields; |
0 | 1975 |
1976 if (flags & TDF_RAW) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1977 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1978 dump_gimple_fmt (buffer, spc, flags, "%G <%+STRING <%n%s%n>", gs, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1979 gimple_asm_string (gs)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1980 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1981 n = gimple_asm_noutputs (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1982 if (n) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1983 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1984 newline_and_indent (buffer, spc + 2); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1985 pp_string (buffer, "OUTPUT: "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1986 for (i = 0; i < n; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1987 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1988 dump_generic_node (buffer, gimple_asm_output_op (gs, i), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1989 spc, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1990 if (i < n - 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1991 pp_string (buffer, ", "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1992 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1993 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1994 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1995 n = gimple_asm_ninputs (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1996 if (n) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1997 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1998 newline_and_indent (buffer, spc + 2); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
1999 pp_string (buffer, "INPUT: "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2000 for (i = 0; i < n; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2001 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2002 dump_generic_node (buffer, gimple_asm_input_op (gs, i), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2003 spc, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2004 if (i < n - 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2005 pp_string (buffer, ", "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2006 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2007 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2008 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2009 n = gimple_asm_nclobbers (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2010 if (n) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2011 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2012 newline_and_indent (buffer, spc + 2); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2013 pp_string (buffer, "CLOBBER: "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2014 for (i = 0; i < n; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2015 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2016 dump_generic_node (buffer, gimple_asm_clobber_op (gs, i), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2017 spc, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2018 if (i < n - 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2019 pp_string (buffer, ", "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2020 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2021 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2022 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2023 n = gimple_asm_nlabels (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2024 if (n) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2025 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2026 newline_and_indent (buffer, spc + 2); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2027 pp_string (buffer, "LABEL: "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2028 for (i = 0; i < n; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2029 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2030 dump_generic_node (buffer, gimple_asm_label_op (gs, i), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2031 spc, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2032 if (i < n - 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2033 pp_string (buffer, ", "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2034 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2035 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2036 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2037 newline_and_indent (buffer, spc); |
111 | 2038 pp_greater (buffer); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2039 } |
0 | 2040 else |
2041 { | |
2042 pp_string (buffer, "__asm__"); | |
2043 if (gimple_asm_volatile_p (gs)) | |
2044 pp_string (buffer, " __volatile__"); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2045 if (gimple_asm_nlabels (gs)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2046 pp_string (buffer, " goto"); |
0 | 2047 pp_string (buffer, "(\""); |
2048 pp_string (buffer, gimple_asm_string (gs)); | |
2049 pp_string (buffer, "\""); | |
2050 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2051 if (gimple_asm_nlabels (gs)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2052 fields = 4; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2053 else if (gimple_asm_nclobbers (gs)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2054 fields = 3; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2055 else if (gimple_asm_ninputs (gs)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2056 fields = 2; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2057 else if (gimple_asm_noutputs (gs)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2058 fields = 1; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2059 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2060 fields = 0; |
0 | 2061 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2062 for (f = 0; f < fields; ++f) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2063 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2064 pp_string (buffer, " : "); |
0 | 2065 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2066 switch (f) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2067 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2068 case 0: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2069 n = gimple_asm_noutputs (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2070 for (i = 0; i < n; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2071 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2072 dump_generic_node (buffer, gimple_asm_output_op (gs, i), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2073 spc, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2074 if (i < n - 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2075 pp_string (buffer, ", "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2076 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2077 break; |
0 | 2078 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2079 case 1: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2080 n = gimple_asm_ninputs (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2081 for (i = 0; i < n; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2082 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2083 dump_generic_node (buffer, gimple_asm_input_op (gs, i), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2084 spc, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2085 if (i < n - 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2086 pp_string (buffer, ", "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2087 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2088 break; |
0 | 2089 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2090 case 2: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2091 n = gimple_asm_nclobbers (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2092 for (i = 0; i < n; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2093 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2094 dump_generic_node (buffer, gimple_asm_clobber_op (gs, i), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2095 spc, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2096 if (i < n - 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2097 pp_string (buffer, ", "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2098 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2099 break; |
0 | 2100 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2101 case 3: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2102 n = gimple_asm_nlabels (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2103 for (i = 0; i < n; i++) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2104 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2105 dump_generic_node (buffer, gimple_asm_label_op (gs, i), |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2106 spc, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2107 if (i < n - 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2108 pp_string (buffer, ", "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2109 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2110 break; |
0 | 2111 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2112 default: |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2113 gcc_unreachable (); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2114 } |
0 | 2115 } |
2116 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2117 pp_string (buffer, ");"); |
0 | 2118 } |
2119 } | |
2120 | |
111 | 2121 /* Dump ptr_info and range_info for NODE on pretty_printer BUFFER with |
2122 SPC spaces of indent. */ | |
0 | 2123 |
2124 static void | |
111 | 2125 dump_ssaname_info (pretty_printer *buffer, tree node, int spc) |
2126 { | |
2127 if (TREE_CODE (node) != SSA_NAME) | |
2128 return; | |
2129 | |
2130 if (POINTER_TYPE_P (TREE_TYPE (node)) | |
2131 && SSA_NAME_PTR_INFO (node)) | |
2132 { | |
2133 unsigned int align, misalign; | |
2134 struct ptr_info_def *pi = SSA_NAME_PTR_INFO (node); | |
2135 pp_string (buffer, "# PT = "); | |
2136 pp_points_to_solution (buffer, &pi->pt); | |
2137 newline_and_indent (buffer, spc); | |
2138 if (get_ptr_info_alignment (pi, &align, &misalign)) | |
2139 { | |
2140 pp_printf (buffer, "# ALIGN = %u, MISALIGN = %u", align, misalign); | |
2141 newline_and_indent (buffer, spc); | |
2142 } | |
2143 } | |
2144 | |
2145 if (!POINTER_TYPE_P (TREE_TYPE (node)) | |
2146 && SSA_NAME_RANGE_INFO (node)) | |
2147 { | |
2148 wide_int min, max, nonzero_bits; | |
2149 value_range_type range_type = get_range_info (node, &min, &max); | |
2150 | |
2151 if (range_type == VR_VARYING) | |
2152 pp_printf (buffer, "# RANGE VR_VARYING"); | |
2153 else if (range_type == VR_RANGE || range_type == VR_ANTI_RANGE) | |
2154 { | |
2155 pp_printf (buffer, "# RANGE "); | |
2156 pp_printf (buffer, "%s[", range_type == VR_RANGE ? "" : "~"); | |
2157 pp_wide_int (buffer, min, TYPE_SIGN (TREE_TYPE (node))); | |
2158 pp_printf (buffer, ", "); | |
2159 pp_wide_int (buffer, max, TYPE_SIGN (TREE_TYPE (node))); | |
2160 pp_printf (buffer, "]"); | |
2161 } | |
2162 nonzero_bits = get_nonzero_bits (node); | |
2163 if (nonzero_bits != -1) | |
2164 { | |
2165 pp_string (buffer, " NONZERO "); | |
2166 pp_wide_int (buffer, nonzero_bits, UNSIGNED); | |
2167 } | |
2168 newline_and_indent (buffer, spc); | |
2169 } | |
2170 } | |
2171 | |
2172 /* As dump_ssaname_info, but dump to FILE. */ | |
2173 | |
2174 void | |
2175 dump_ssaname_info_to_file (FILE *file, tree node, int spc) | |
2176 { | |
2177 pretty_printer buffer; | |
2178 pp_needs_newline (&buffer) = true; | |
2179 buffer.buffer->stream = file; | |
2180 dump_ssaname_info (&buffer, node, spc); | |
2181 pp_flush (&buffer); | |
2182 } | |
2183 | |
2184 /* Dump a PHI node PHI. BUFFER, SPC and FLAGS are as in pp_gimple_stmt_1. | |
2185 The caller is responsible for calling pp_flush on BUFFER to finalize | |
2186 pretty printer. If COMMENT is true, print this after #. */ | |
2187 | |
2188 static void | |
2189 dump_gimple_phi (pretty_printer *buffer, gphi *phi, int spc, bool comment, | |
2190 dump_flags_t flags) | |
0 | 2191 { |
2192 size_t i; | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
2193 tree lhs = gimple_phi_result (phi); |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
2194 |
111 | 2195 if (flags & TDF_ALIAS) |
2196 dump_ssaname_info (buffer, lhs, spc); | |
2197 | |
2198 if (comment) | |
2199 pp_string (buffer, "# "); | |
0 | 2200 |
2201 if (flags & TDF_RAW) | |
111 | 2202 dump_gimple_fmt (buffer, spc, flags, "%G <%T, ", phi, |
2203 gimple_phi_result (phi)); | |
0 | 2204 else |
2205 { | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
2206 dump_generic_node (buffer, lhs, spc, flags, false); |
111 | 2207 if (flags & TDF_GIMPLE) |
2208 pp_string (buffer, " = __PHI ("); | |
2209 else | |
2210 pp_string (buffer, " = PHI <"); | |
0 | 2211 } |
2212 for (i = 0; i < gimple_phi_num_args (phi); i++) | |
2213 { | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2214 if ((flags & TDF_LINENO) && gimple_phi_arg_has_location (phi, i)) |
111 | 2215 dump_location (buffer, gimple_phi_arg_location (phi, i)); |
2216 if (flags & TDF_GIMPLE) | |
2217 { | |
2218 basic_block src = gimple_phi_arg_edge (phi, i)->src; | |
2219 gimple *stmt = first_stmt (src); | |
2220 if (!stmt || gimple_code (stmt) != GIMPLE_LABEL) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2221 { |
111 | 2222 pp_string (buffer, "bb_"); |
2223 pp_decimal_int (buffer, src->index); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2224 } |
111 | 2225 else |
2226 dump_generic_node (buffer, gimple_label_label (as_a <glabel *> (stmt)), 0, flags, | |
2227 false); | |
2228 pp_string (buffer, ": "); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2229 } |
0 | 2230 dump_generic_node (buffer, gimple_phi_arg_def (phi, i), spc, flags, |
2231 false); | |
111 | 2232 if (! (flags & TDF_GIMPLE)) |
2233 { | |
2234 pp_left_paren (buffer); | |
2235 pp_decimal_int (buffer, gimple_phi_arg_edge (phi, i)->src->index); | |
2236 pp_right_paren (buffer); | |
2237 } | |
0 | 2238 if (i < gimple_phi_num_args (phi) - 1) |
2239 pp_string (buffer, ", "); | |
2240 } | |
111 | 2241 if (flags & TDF_GIMPLE) |
2242 pp_string (buffer, ");"); | |
2243 else | |
2244 pp_greater (buffer); | |
0 | 2245 } |
2246 | |
2247 | |
2248 /* Dump a GIMPLE_OMP_PARALLEL tuple on the pretty_printer BUFFER, SPC spaces | |
2249 of indent. FLAGS specifies details to show in the dump (see TDF_* in | |
111 | 2250 dumpfile.h). */ |
0 | 2251 |
2252 static void | |
111 | 2253 dump_gimple_omp_parallel (pretty_printer *buffer, gomp_parallel *gs, |
2254 int spc, dump_flags_t flags) | |
0 | 2255 { |
2256 if (flags & TDF_RAW) | |
2257 { | |
2258 dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S>%nCLAUSES <", gs, | |
2259 gimple_omp_body (gs)); | |
2260 dump_omp_clauses (buffer, gimple_omp_parallel_clauses (gs), spc, flags); | |
2261 dump_gimple_fmt (buffer, spc, flags, " >, %T, %T%n>", | |
2262 gimple_omp_parallel_child_fn (gs), | |
2263 gimple_omp_parallel_data_arg (gs)); | |
2264 } | |
2265 else | |
2266 { | |
2267 gimple_seq body; | |
2268 pp_string (buffer, "#pragma omp parallel"); | |
2269 dump_omp_clauses (buffer, gimple_omp_parallel_clauses (gs), spc, flags); | |
2270 if (gimple_omp_parallel_child_fn (gs)) | |
2271 { | |
2272 pp_string (buffer, " [child fn: "); | |
2273 dump_generic_node (buffer, gimple_omp_parallel_child_fn (gs), | |
2274 spc, flags, false); | |
2275 pp_string (buffer, " ("); | |
2276 if (gimple_omp_parallel_data_arg (gs)) | |
2277 dump_generic_node (buffer, gimple_omp_parallel_data_arg (gs), | |
2278 spc, flags, false); | |
2279 else | |
2280 pp_string (buffer, "???"); | |
2281 pp_string (buffer, ")]"); | |
2282 } | |
2283 body = gimple_omp_body (gs); | |
2284 if (body && gimple_code (gimple_seq_first_stmt (body)) != GIMPLE_BIND) | |
2285 { | |
2286 newline_and_indent (buffer, spc + 2); | |
111 | 2287 pp_left_brace (buffer); |
0 | 2288 pp_newline (buffer); |
2289 dump_gimple_seq (buffer, body, spc + 4, flags); | |
2290 newline_and_indent (buffer, spc + 2); | |
111 | 2291 pp_right_brace (buffer); |
0 | 2292 } |
2293 else if (body) | |
2294 { | |
2295 pp_newline (buffer); | |
2296 dump_gimple_seq (buffer, body, spc + 2, flags); | |
2297 } | |
2298 } | |
2299 } | |
2300 | |
2301 | |
2302 /* Dump a GIMPLE_OMP_TASK tuple on the pretty_printer BUFFER, SPC spaces | |
2303 of indent. FLAGS specifies details to show in the dump (see TDF_* in | |
111 | 2304 dumpfile.h). */ |
0 | 2305 |
2306 static void | |
111 | 2307 dump_gimple_omp_task (pretty_printer *buffer, gomp_task *gs, int spc, |
2308 dump_flags_t flags) | |
0 | 2309 { |
2310 if (flags & TDF_RAW) | |
2311 { | |
2312 dump_gimple_fmt (buffer, spc, flags, "%G <%+BODY <%S>%nCLAUSES <", gs, | |
2313 gimple_omp_body (gs)); | |
2314 dump_omp_clauses (buffer, gimple_omp_task_clauses (gs), spc, flags); | |
2315 dump_gimple_fmt (buffer, spc, flags, " >, %T, %T, %T, %T, %T%n>", | |
2316 gimple_omp_task_child_fn (gs), | |
2317 gimple_omp_task_data_arg (gs), | |
2318 gimple_omp_task_copy_fn (gs), | |
2319 gimple_omp_task_arg_size (gs), | |
2320 gimple_omp_task_arg_size (gs)); | |
2321 } | |
2322 else | |
2323 { | |
2324 gimple_seq body; | |
111 | 2325 if (gimple_omp_task_taskloop_p (gs)) |
2326 pp_string (buffer, "#pragma omp taskloop"); | |
2327 else | |
2328 pp_string (buffer, "#pragma omp task"); | |
0 | 2329 dump_omp_clauses (buffer, gimple_omp_task_clauses (gs), spc, flags); |
2330 if (gimple_omp_task_child_fn (gs)) | |
2331 { | |
2332 pp_string (buffer, " [child fn: "); | |
2333 dump_generic_node (buffer, gimple_omp_task_child_fn (gs), | |
2334 spc, flags, false); | |
2335 pp_string (buffer, " ("); | |
2336 if (gimple_omp_task_data_arg (gs)) | |
2337 dump_generic_node (buffer, gimple_omp_task_data_arg (gs), | |
2338 spc, flags, false); | |
2339 else | |
2340 pp_string (buffer, "???"); | |
2341 pp_string (buffer, ")]"); | |
2342 } | |
2343 body = gimple_omp_body (gs); | |
2344 if (body && gimple_code (gimple_seq_first_stmt (body)) != GIMPLE_BIND) | |
2345 { | |
2346 newline_and_indent (buffer, spc + 2); | |
111 | 2347 pp_left_brace (buffer); |
0 | 2348 pp_newline (buffer); |
2349 dump_gimple_seq (buffer, body, spc + 4, flags); | |
2350 newline_and_indent (buffer, spc + 2); | |
111 | 2351 pp_right_brace (buffer); |
0 | 2352 } |
2353 else if (body) | |
2354 { | |
2355 pp_newline (buffer); | |
2356 dump_gimple_seq (buffer, body, spc + 2, flags); | |
2357 } | |
2358 } | |
2359 } | |
2360 | |
2361 | |
2362 /* Dump a GIMPLE_OMP_ATOMIC_LOAD tuple on the pretty_printer BUFFER, SPC | |
2363 spaces of indent. FLAGS specifies details to show in the dump (see TDF_* | |
111 | 2364 in dumpfile.h). */ |
0 | 2365 |
2366 static void | |
111 | 2367 dump_gimple_omp_atomic_load (pretty_printer *buffer, gomp_atomic_load *gs, |
2368 int spc, dump_flags_t flags) | |
0 | 2369 { |
2370 if (flags & TDF_RAW) | |
2371 { | |
2372 dump_gimple_fmt (buffer, spc, flags, "%G <%T, %T>", gs, | |
2373 gimple_omp_atomic_load_lhs (gs), | |
2374 gimple_omp_atomic_load_rhs (gs)); | |
2375 } | |
2376 else | |
2377 { | |
2378 pp_string (buffer, "#pragma omp atomic_load"); | |
111 | 2379 if (gimple_omp_atomic_seq_cst_p (gs)) |
2380 pp_string (buffer, " seq_cst"); | |
2381 if (gimple_omp_atomic_need_value_p (gs)) | |
2382 pp_string (buffer, " [needed]"); | |
0 | 2383 newline_and_indent (buffer, spc + 2); |
2384 dump_generic_node (buffer, gimple_omp_atomic_load_lhs (gs), | |
2385 spc, flags, false); | |
2386 pp_space (buffer); | |
111 | 2387 pp_equal (buffer); |
0 | 2388 pp_space (buffer); |
111 | 2389 pp_star (buffer); |
0 | 2390 dump_generic_node (buffer, gimple_omp_atomic_load_rhs (gs), |
2391 spc, flags, false); | |
2392 } | |
2393 } | |
2394 | |
2395 /* Dump a GIMPLE_OMP_ATOMIC_STORE tuple on the pretty_printer BUFFER, SPC | |
2396 spaces of indent. FLAGS specifies details to show in the dump (see TDF_* | |
111 | 2397 in dumpfile.h). */ |
0 | 2398 |
2399 static void | |
111 | 2400 dump_gimple_omp_atomic_store (pretty_printer *buffer, |
2401 gomp_atomic_store *gs, int spc, | |
2402 dump_flags_t flags) | |
0 | 2403 { |
2404 if (flags & TDF_RAW) | |
2405 { | |
2406 dump_gimple_fmt (buffer, spc, flags, "%G <%T>", gs, | |
2407 gimple_omp_atomic_store_val (gs)); | |
2408 } | |
2409 else | |
2410 { | |
111 | 2411 pp_string (buffer, "#pragma omp atomic_store "); |
2412 if (gimple_omp_atomic_seq_cst_p (gs)) | |
2413 pp_string (buffer, "seq_cst "); | |
2414 if (gimple_omp_atomic_need_value_p (gs)) | |
2415 pp_string (buffer, "[needed] "); | |
2416 pp_left_paren (buffer); | |
0 | 2417 dump_generic_node (buffer, gimple_omp_atomic_store_val (gs), |
2418 spc, flags, false); | |
111 | 2419 pp_right_paren (buffer); |
0 | 2420 } |
2421 } | |
2422 | |
2423 | |
2424 /* Dump all the memory operands for statement GS. BUFFER, SPC and | |
111 | 2425 FLAGS are as in pp_gimple_stmt_1. */ |
0 | 2426 |
2427 static void | |
111 | 2428 dump_gimple_mem_ops (pretty_printer *buffer, gimple *gs, int spc, |
2429 dump_flags_t flags) | |
0 | 2430 { |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2431 tree vdef = gimple_vdef (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2432 tree vuse = gimple_vuse (gs); |
0 | 2433 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2434 if (vdef != NULL_TREE) |
0 | 2435 { |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2436 pp_string (buffer, "# "); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2437 dump_generic_node (buffer, vdef, spc + 2, flags, false); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2438 pp_string (buffer, " = VDEF <"); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2439 dump_generic_node (buffer, vuse, spc + 2, flags, false); |
111 | 2440 pp_greater (buffer); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2441 newline_and_indent (buffer, spc); |
0 | 2442 } |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2443 else if (vuse != NULL_TREE) |
0 | 2444 { |
2445 pp_string (buffer, "# VUSE <"); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2446 dump_generic_node (buffer, vuse, spc + 2, flags, false); |
111 | 2447 pp_greater (buffer); |
0 | 2448 newline_and_indent (buffer, spc); |
2449 } | |
2450 } | |
2451 | |
2452 | |
111 | 2453 /* Print the gimple statement GS on the pretty printer BUFFER, SPC |
0 | 2454 spaces of indent. FLAGS specifies details to show in the dump (see |
111 | 2455 TDF_* in dumpfile.h). The caller is responsible for calling |
2456 pp_flush on BUFFER to finalize the pretty printer. */ | |
0 | 2457 |
2458 void | |
111 | 2459 pp_gimple_stmt_1 (pretty_printer *buffer, gimple *gs, int spc, |
2460 dump_flags_t flags) | |
0 | 2461 { |
2462 if (!gs) | |
2463 return; | |
2464 | |
2465 if (flags & TDF_STMTADDR) | |
2466 pp_printf (buffer, "<&%p> ", (void *) gs); | |
2467 | |
2468 if ((flags & TDF_LINENO) && gimple_has_location (gs)) | |
111 | 2469 dump_location (buffer, gimple_location (gs)); |
0 | 2470 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2471 if (flags & TDF_EH) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2472 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2473 int lp_nr = lookup_stmt_eh_lp (gs); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2474 if (lp_nr > 0) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2475 pp_printf (buffer, "[LP %d] ", lp_nr); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2476 else if (lp_nr < 0) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2477 pp_printf (buffer, "[MNT %d] ", -lp_nr); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2478 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2479 |
0 | 2480 if ((flags & (TDF_VOPS|TDF_MEMSYMS)) |
2481 && gimple_has_mem_ops (gs)) | |
2482 dump_gimple_mem_ops (buffer, gs, spc, flags); | |
2483 | |
111 | 2484 if (gimple_has_lhs (gs) |
2485 && (flags & TDF_ALIAS)) | |
2486 dump_ssaname_info (buffer, gimple_get_lhs (gs), spc); | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
2487 |
0 | 2488 switch (gimple_code (gs)) |
2489 { | |
2490 case GIMPLE_ASM: | |
111 | 2491 dump_gimple_asm (buffer, as_a <gasm *> (gs), spc, flags); |
0 | 2492 break; |
2493 | |
2494 case GIMPLE_ASSIGN: | |
111 | 2495 dump_gimple_assign (buffer, as_a <gassign *> (gs), spc, flags); |
0 | 2496 break; |
2497 | |
2498 case GIMPLE_BIND: | |
111 | 2499 dump_gimple_bind (buffer, as_a <gbind *> (gs), spc, flags); |
0 | 2500 break; |
2501 | |
2502 case GIMPLE_CALL: | |
111 | 2503 dump_gimple_call (buffer, as_a <gcall *> (gs), spc, flags); |
0 | 2504 break; |
2505 | |
2506 case GIMPLE_COND: | |
111 | 2507 dump_gimple_cond (buffer, as_a <gcond *> (gs), spc, flags); |
0 | 2508 break; |
2509 | |
2510 case GIMPLE_LABEL: | |
111 | 2511 dump_gimple_label (buffer, as_a <glabel *> (gs), spc, flags); |
0 | 2512 break; |
2513 | |
2514 case GIMPLE_GOTO: | |
111 | 2515 dump_gimple_goto (buffer, as_a <ggoto *> (gs), spc, flags); |
0 | 2516 break; |
2517 | |
2518 case GIMPLE_NOP: | |
2519 pp_string (buffer, "GIMPLE_NOP"); | |
2520 break; | |
2521 | |
2522 case GIMPLE_RETURN: | |
111 | 2523 dump_gimple_return (buffer, as_a <greturn *> (gs), spc, flags); |
0 | 2524 break; |
2525 | |
2526 case GIMPLE_SWITCH: | |
111 | 2527 dump_gimple_switch (buffer, as_a <gswitch *> (gs), spc, flags); |
0 | 2528 break; |
2529 | |
2530 case GIMPLE_TRY: | |
111 | 2531 dump_gimple_try (buffer, as_a <gtry *> (gs), spc, flags); |
0 | 2532 break; |
2533 | |
2534 case GIMPLE_PHI: | |
111 | 2535 dump_gimple_phi (buffer, as_a <gphi *> (gs), spc, false, flags); |
0 | 2536 break; |
2537 | |
2538 case GIMPLE_OMP_PARALLEL: | |
111 | 2539 dump_gimple_omp_parallel (buffer, as_a <gomp_parallel *> (gs), spc, |
2540 flags); | |
0 | 2541 break; |
2542 | |
2543 case GIMPLE_OMP_TASK: | |
111 | 2544 dump_gimple_omp_task (buffer, as_a <gomp_task *> (gs), spc, flags); |
0 | 2545 break; |
2546 | |
2547 case GIMPLE_OMP_ATOMIC_LOAD: | |
111 | 2548 dump_gimple_omp_atomic_load (buffer, as_a <gomp_atomic_load *> (gs), |
2549 spc, flags); | |
0 | 2550 break; |
2551 | |
2552 case GIMPLE_OMP_ATOMIC_STORE: | |
111 | 2553 dump_gimple_omp_atomic_store (buffer, |
2554 as_a <gomp_atomic_store *> (gs), | |
2555 spc, flags); | |
0 | 2556 break; |
2557 | |
2558 case GIMPLE_OMP_FOR: | |
111 | 2559 dump_gimple_omp_for (buffer, as_a <gomp_for *> (gs), spc, flags); |
0 | 2560 break; |
2561 | |
2562 case GIMPLE_OMP_CONTINUE: | |
111 | 2563 dump_gimple_omp_continue (buffer, as_a <gomp_continue *> (gs), spc, |
2564 flags); | |
0 | 2565 break; |
2566 | |
2567 case GIMPLE_OMP_SINGLE: | |
111 | 2568 dump_gimple_omp_single (buffer, as_a <gomp_single *> (gs), spc, |
2569 flags); | |
2570 break; | |
2571 | |
2572 case GIMPLE_OMP_TARGET: | |
2573 dump_gimple_omp_target (buffer, as_a <gomp_target *> (gs), spc, | |
2574 flags); | |
2575 break; | |
2576 | |
2577 case GIMPLE_OMP_TEAMS: | |
2578 dump_gimple_omp_teams (buffer, as_a <gomp_teams *> (gs), spc, | |
2579 flags); | |
0 | 2580 break; |
2581 | |
2582 case GIMPLE_OMP_RETURN: | |
2583 dump_gimple_omp_return (buffer, gs, spc, flags); | |
2584 break; | |
2585 | |
2586 case GIMPLE_OMP_SECTIONS: | |
111 | 2587 dump_gimple_omp_sections (buffer, as_a <gomp_sections *> (gs), |
2588 spc, flags); | |
0 | 2589 break; |
2590 | |
2591 case GIMPLE_OMP_SECTIONS_SWITCH: | |
2592 pp_string (buffer, "GIMPLE_SECTIONS_SWITCH"); | |
2593 break; | |
2594 | |
2595 case GIMPLE_OMP_MASTER: | |
111 | 2596 case GIMPLE_OMP_TASKGROUP: |
0 | 2597 case GIMPLE_OMP_SECTION: |
111 | 2598 case GIMPLE_OMP_GRID_BODY: |
0 | 2599 dump_gimple_omp_block (buffer, gs, spc, flags); |
2600 break; | |
2601 | |
111 | 2602 case GIMPLE_OMP_ORDERED: |
2603 dump_gimple_omp_ordered (buffer, as_a <gomp_ordered *> (gs), spc, | |
2604 flags); | |
2605 break; | |
2606 | |
0 | 2607 case GIMPLE_OMP_CRITICAL: |
111 | 2608 dump_gimple_omp_critical (buffer, as_a <gomp_critical *> (gs), spc, |
2609 flags); | |
0 | 2610 break; |
2611 | |
2612 case GIMPLE_CATCH: | |
111 | 2613 dump_gimple_catch (buffer, as_a <gcatch *> (gs), spc, flags); |
0 | 2614 break; |
2615 | |
2616 case GIMPLE_EH_FILTER: | |
111 | 2617 dump_gimple_eh_filter (buffer, as_a <geh_filter *> (gs), spc, flags); |
0 | 2618 break; |
2619 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2620 case GIMPLE_EH_MUST_NOT_THROW: |
111 | 2621 dump_gimple_eh_must_not_throw (buffer, |
2622 as_a <geh_mnt *> (gs), | |
2623 spc, flags); | |
2624 break; | |
2625 | |
2626 case GIMPLE_EH_ELSE: | |
2627 dump_gimple_eh_else (buffer, as_a <geh_else *> (gs), spc, flags); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2628 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2629 |
0 | 2630 case GIMPLE_RESX: |
111 | 2631 dump_gimple_resx (buffer, as_a <gresx *> (gs), spc, flags); |
0 | 2632 break; |
2633 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2634 case GIMPLE_EH_DISPATCH: |
111 | 2635 dump_gimple_eh_dispatch (buffer, as_a <geh_dispatch *> (gs), spc, |
2636 flags); | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2637 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2638 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2639 case GIMPLE_DEBUG: |
111 | 2640 dump_gimple_debug (buffer, as_a <gdebug *> (gs), spc, flags); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2641 break; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2642 |
0 | 2643 case GIMPLE_PREDICT: |
2644 pp_string (buffer, "// predicted "); | |
2645 if (gimple_predict_outcome (gs)) | |
2646 pp_string (buffer, "likely by "); | |
2647 else | |
2648 pp_string (buffer, "unlikely by "); | |
2649 pp_string (buffer, predictor_name (gimple_predict_predictor (gs))); | |
2650 pp_string (buffer, " predictor."); | |
2651 break; | |
2652 | |
111 | 2653 case GIMPLE_TRANSACTION: |
2654 dump_gimple_transaction (buffer, as_a <gtransaction *> (gs), spc, | |
2655 flags); | |
2656 break; | |
2657 | |
0 | 2658 default: |
2659 GIMPLE_NIY; | |
2660 } | |
2661 } | |
2662 | |
2663 | |
111 | 2664 /* Dumps header of basic block BB to OUTF indented by INDENT |
0 | 2665 spaces and details described by flags. */ |
2666 | |
2667 static void | |
111 | 2668 dump_gimple_bb_header (FILE *outf, basic_block bb, int indent, |
2669 dump_flags_t flags) | |
0 | 2670 { |
2671 if (flags & TDF_BLOCKS) | |
2672 { | |
2673 if (flags & TDF_LINENO) | |
2674 { | |
2675 gimple_stmt_iterator gsi; | |
2676 | |
111 | 2677 fputs (";; ", outf); |
2678 | |
0 | 2679 for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2680 if (!is_gimple_debug (gsi_stmt (gsi)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
0
diff
changeset
|
2681 && get_lineno (gsi_stmt (gsi)) != UNKNOWN_LOCATION) |
0 | 2682 { |
111 | 2683 fprintf (outf, "%*sstarting at line %d", |
2684 indent, "", get_lineno (gsi_stmt (gsi))); | |
0 | 2685 break; |
2686 } | |
111 | 2687 if (bb->discriminator) |
2688 fprintf (outf, ", discriminator %i", bb->discriminator); | |
2689 fputc ('\n', outf); | |
0 | 2690 } |
2691 } | |
2692 else | |
2693 { | |
111 | 2694 if (flags & TDF_GIMPLE) |
2695 fprintf (outf, "%*sbb_%d:\n", indent, "", bb->index); | |
2696 else | |
2697 fprintf (outf, "%*s<bb %d> %s:\n", | |
2698 indent, "", bb->index, dump_profile (bb->frequency, | |
2699 bb->count)); | |
0 | 2700 } |
2701 } | |
2702 | |
2703 | |
2704 /* Dumps end of basic block BB to buffer BUFFER indented by INDENT | |
2705 spaces. */ | |
2706 | |
2707 static void | |
111 | 2708 dump_gimple_bb_footer (FILE *outf ATTRIBUTE_UNUSED, |
2709 basic_block bb ATTRIBUTE_UNUSED, | |
2710 int indent ATTRIBUTE_UNUSED, | |
2711 dump_flags_t flags ATTRIBUTE_UNUSED) | |
0 | 2712 { |
111 | 2713 /* There is currently no GIMPLE-specific basic block info to dump. */ |
2714 return; | |
0 | 2715 } |
2716 | |
2717 | |
2718 /* Dump PHI nodes of basic block BB to BUFFER with details described | |
2719 by FLAGS and indented by INDENT spaces. */ | |
2720 | |
2721 static void | |
111 | 2722 dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, |
2723 dump_flags_t flags) | |
0 | 2724 { |
111 | 2725 gphi_iterator i; |
0 | 2726 |
2727 for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i)) | |
2728 { | |
111 | 2729 gphi *phi = i.phi (); |
2730 if (!virtual_operand_p (gimple_phi_result (phi)) || (flags & TDF_VOPS)) | |
0 | 2731 { |
2732 INDENT (indent); | |
111 | 2733 dump_gimple_phi (buffer, phi, indent, |
2734 (flags & TDF_GIMPLE) ? false : true, flags); | |
0 | 2735 pp_newline (buffer); |
2736 } | |
2737 } | |
2738 } | |
2739 | |
2740 | |
2741 /* Dump jump to basic block BB that is represented implicitly in the cfg | |
2742 to BUFFER. */ | |
2743 | |
2744 static void | |
111 | 2745 pp_cfg_jump (pretty_printer *buffer, edge e, dump_flags_t flags) |
0 | 2746 { |
111 | 2747 if (flags & TDF_GIMPLE) |
0 | 2748 { |
111 | 2749 pp_string (buffer, "goto bb_"); |
2750 pp_decimal_int (buffer, e->dest->index); | |
0 | 2751 pp_semicolon (buffer); |
2752 } | |
2753 else | |
111 | 2754 { |
2755 pp_string (buffer, "goto <bb "); | |
2756 pp_decimal_int (buffer, e->dest->index); | |
2757 pp_greater (buffer); | |
2758 pp_semicolon (buffer); | |
2759 | |
2760 dump_edge_probability (buffer, e); | |
2761 } | |
0 | 2762 } |
2763 | |
2764 | |
2765 /* Dump edges represented implicitly in basic block BB to BUFFER, indented | |
2766 by INDENT spaces, with details given by FLAGS. */ | |
2767 | |
2768 static void | |
2769 dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent, | |
111 | 2770 dump_flags_t flags) |
0 | 2771 { |
2772 edge e; | |
111 | 2773 gimple *stmt; |
0 | 2774 |
2775 stmt = last_stmt (bb); | |
2776 | |
2777 if (stmt && gimple_code (stmt) == GIMPLE_COND) | |
2778 { | |
2779 edge true_edge, false_edge; | |
2780 | |
2781 /* When we are emitting the code or changing CFG, it is possible that | |
2782 the edges are not yet created. When we are using debug_bb in such | |
2783 a situation, we do not want it to crash. */ | |
2784 if (EDGE_COUNT (bb->succs) != 2) | |
2785 return; | |
2786 extract_true_false_edges_from_block (bb, &true_edge, &false_edge); | |
2787 | |
2788 INDENT (indent + 2); | |
111 | 2789 pp_cfg_jump (buffer, true_edge, flags); |
0 | 2790 newline_and_indent (buffer, indent); |
2791 pp_string (buffer, "else"); | |
2792 newline_and_indent (buffer, indent + 2); | |
111 | 2793 pp_cfg_jump (buffer, false_edge, flags); |
0 | 2794 pp_newline (buffer); |
2795 return; | |
2796 } | |
2797 | |
2798 /* If there is a fallthru edge, we may need to add an artificial | |
2799 goto to the dump. */ | |
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
|
2800 e = find_fallthru_edge (bb->succs); |
0 | 2801 |
2802 if (e && e->dest != bb->next_bb) | |
2803 { | |
2804 INDENT (indent); | |
2805 | |
2806 if ((flags & TDF_LINENO) | |
111 | 2807 && e->goto_locus != UNKNOWN_LOCATION) |
2808 dump_location (buffer, e->goto_locus); | |
0 | 2809 |
111 | 2810 pp_cfg_jump (buffer, e, flags); |
0 | 2811 pp_newline (buffer); |
2812 } | |
2813 } | |
2814 | |
2815 | |
2816 /* Dumps basic block BB to buffer BUFFER with details described by FLAGS and | |
2817 indented by INDENT spaces. */ | |
2818 | |
2819 static void | |
2820 gimple_dump_bb_buff (pretty_printer *buffer, basic_block bb, int indent, | |
111 | 2821 dump_flags_t flags) |
0 | 2822 { |
2823 gimple_stmt_iterator gsi; | |
111 | 2824 gimple *stmt; |
0 | 2825 int label_indent = indent - 2; |
2826 | |
2827 if (label_indent < 0) | |
2828 label_indent = 0; | |
2829 | |
2830 dump_phi_nodes (buffer, bb, indent, flags); | |
2831 | |
2832 for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) | |
2833 { | |
2834 int curr_indent; | |
2835 | |
2836 stmt = gsi_stmt (gsi); | |
2837 | |
2838 curr_indent = gimple_code (stmt) == GIMPLE_LABEL ? label_indent : indent; | |
2839 | |
2840 INDENT (curr_indent); | |
111 | 2841 pp_gimple_stmt_1 (buffer, stmt, curr_indent, flags); |
2842 pp_newline_and_flush (buffer); | |
2843 gcc_checking_assert (DECL_STRUCT_FUNCTION (current_function_decl)); | |
2844 dump_histograms_for_stmt (DECL_STRUCT_FUNCTION (current_function_decl), | |
2845 pp_buffer (buffer)->stream, stmt); | |
0 | 2846 } |
2847 | |
2848 dump_implicit_edges (buffer, bb, indent, flags); | |
111 | 2849 pp_flush (buffer); |
0 | 2850 } |
2851 | |
2852 | |
2853 /* Dumps basic block BB to FILE with details described by FLAGS and | |
2854 indented by INDENT spaces. */ | |
2855 | |
2856 void | |
111 | 2857 gimple_dump_bb (FILE *file, basic_block bb, int indent, dump_flags_t flags) |
2858 { | |
2859 dump_gimple_bb_header (file, bb, indent, flags); | |
2860 if (bb->index >= NUM_FIXED_BLOCKS) | |
2861 { | |
2862 pretty_printer buffer; | |
2863 pp_needs_newline (&buffer) = true; | |
2864 buffer.buffer->stream = file; | |
2865 gimple_dump_bb_buff (&buffer, bb, indent, flags); | |
2866 } | |
2867 dump_gimple_bb_footer (file, bb, indent, flags); | |
2868 } | |
2869 | |
2870 /* Dumps basic block BB to pretty-printer PP with default dump flags and | |
2871 no indentation, for use as a label of a DOT graph record-node. | |
2872 ??? Should just use gimple_dump_bb_buff here, except that value profiling | |
2873 histogram dumping doesn't know about pretty-printers. */ | |
2874 | |
2875 void | |
2876 gimple_dump_bb_for_graph (pretty_printer *pp, basic_block bb) | |
0 | 2877 { |
111 | 2878 pp_printf (pp, "<bb %d>:\n", bb->index); |
2879 pp_write_text_as_dot_label_to_stream (pp, /*for_record=*/true); | |
2880 | |
2881 for (gphi_iterator gsi = gsi_start_phis (bb); !gsi_end_p (gsi); | |
2882 gsi_next (&gsi)) | |
2883 { | |
2884 gphi *phi = gsi.phi (); | |
2885 if (!virtual_operand_p (gimple_phi_result (phi)) | |
2886 || (dump_flags & TDF_VOPS)) | |
2887 { | |
2888 pp_bar (pp); | |
2889 pp_write_text_to_stream (pp); | |
2890 pp_string (pp, "# "); | |
2891 pp_gimple_stmt_1 (pp, phi, 0, dump_flags); | |
2892 pp_newline (pp); | |
2893 pp_write_text_as_dot_label_to_stream (pp, /*for_record=*/true); | |
2894 } | |
2895 } | |
2896 | |
2897 for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi); | |
2898 gsi_next (&gsi)) | |
2899 { | |
2900 gimple *stmt = gsi_stmt (gsi); | |
2901 pp_bar (pp); | |
2902 pp_write_text_to_stream (pp); | |
2903 pp_gimple_stmt_1 (pp, stmt, 0, dump_flags); | |
2904 pp_newline (pp); | |
2905 pp_write_text_as_dot_label_to_stream (pp, /*for_record=*/true); | |
2906 } | |
2907 dump_implicit_edges (pp, bb, 0, dump_flags); | |
2908 pp_write_text_as_dot_label_to_stream (pp, /*for_record=*/true); | |
0 | 2909 } |
111 | 2910 |
2911 | |
2912 /* Handle the %G format for TEXT. Same as %K in handle_K_format in | |
2913 tree-pretty-print.c but with a Gimple call statement as an argument. */ | |
2914 | |
2915 void | |
2916 percent_G_format (text_info *text) | |
2917 { | |
2918 gcall *stmt = va_arg (*text->args_ptr, gcall*); | |
2919 | |
2920 /* Build a call expression from the Gimple call statement and | |
2921 pass it to the K formatter that knows how to format it. */ | |
2922 tree exp = build_vl_exp (CALL_EXPR, gimple_call_num_args (stmt) + 3); | |
2923 CALL_EXPR_FN (exp) = gimple_call_fn (stmt); | |
2924 TREE_TYPE (exp) = gimple_call_return_type (stmt); | |
2925 CALL_EXPR_STATIC_CHAIN (exp) = gimple_call_chain (stmt); | |
2926 SET_EXPR_LOCATION (exp, gimple_location (stmt)); | |
2927 | |
2928 percent_K_format (text, exp); | |
2929 } |